ComradeCat
commited on
Commit
·
58168ce
1
Parent(s):
1c270c4
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,166 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- mnist
|
5 |
+
metrics:
|
6 |
+
- accuracy
|
7 |
+
pipeline_tag: image-classification
|
8 |
---
|
9 |
+
|
10 |
+
# Model Card for NNN (Not a Neural Network)
|
11 |
+
|
12 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
13 |
+
|
14 |
+
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
|
15 |
+
Just a simple exercise I did to learn how to use the PyTorch and TorchHD libraries
|
16 |
+
## Model Details
|
17 |
+
|
18 |
+
### Model Description
|
19 |
+
|
20 |
+
<!-- Provide a longer summary of what this model is. -->
|
21 |
+
|
22 |
+
This MNIST model was made using 2 libraries: PyTorch and TorchHD.
|
23 |
+
The HD in TorchHD stands for Hyperdimensional Computing, which means TorchHD is a library that allows you to do hyperdimensional computing in PyTorch.
|
24 |
+
Hyperdimensional Computing (Or HDC) models are much less accurate than neural networks, that's why this model's accuracy is ~82%
|
25 |
+
|
26 |
+
- **Developed by:** Comrade Cat (me)
|
27 |
+
- **Shared by:** Comrade Cat (me)
|
28 |
+
- **Model type:** Image Classification
|
29 |
+
- **Language(s) (NLP):** None
|
30 |
+
- **License:** Apache 2.0
|
31 |
+
- **Finetuned from model:** None. This is a pretrained model.
|
32 |
+
|
33 |
+
### Model Sources [optional]
|
34 |
+
|
35 |
+
<!-- Provide the basic links for the model. -->
|
36 |
+
|
37 |
+
- **Repository:** Here
|
38 |
+
- **Paper:** None
|
39 |
+
- **Demo:** Not available yet.
|
40 |
+
|
41 |
+
## Uses
|
42 |
+
|
43 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
44 |
+
This model is intended to be used as an experiment to compare TorchHD models to PyTorch models.
|
45 |
+
|
46 |
+
### Direct Use
|
47 |
+
|
48 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
49 |
+
This model is intended to be used for recognizing digits. Please be aware that it has a lower accuracy than a normal PyTorch model.
|
50 |
+
|
51 |
+
### Downstream Use
|
52 |
+
|
53 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
54 |
+
|
55 |
+
This model could be fine-tuned to improve its accuracy, as it is surprisingly low.
|
56 |
+
|
57 |
+
### Out-of-Scope Use
|
58 |
+
|
59 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
60 |
+
|
61 |
+
Please do not misuse the model. This model will not work for tasks other than handwritten digit recognition.
|
62 |
+
|
63 |
+
## Bias, Risks, and Limitations
|
64 |
+
|
65 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
66 |
+
|
67 |
+
This model is too simple and inaccurate to be biased against a social group.
|
68 |
+
The technical limitations are its inaccuracy.
|
69 |
+
|
70 |
+
### Recommendations
|
71 |
+
|
72 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
73 |
+
|
74 |
+
Users (both direct and downstream) should be aware of the risks, biases and limitations of the model.
|
75 |
+
Be aware of how inaccurate this model is!!!
|
76 |
+
|
77 |
+
## How to Get Started with the Model
|
78 |
+
|
79 |
+
Download both the model and the encoder. Make sure to download their weights too if you want to fine-tune them!
|
80 |
+
After that you can load them in PyTorch.
|
81 |
+
|
82 |
+
```python
|
83 |
+
import torch
|
84 |
+
|
85 |
+
# Load the base model and weights
|
86 |
+
model = torch.load("mnist.pt")
|
87 |
+
model.load_state_dict(torch.load("mnist_weights.pt"))
|
88 |
+
|
89 |
+
# Load the encoder and its weights
|
90 |
+
encoder = torch.load("mnist_encoder.pt")
|
91 |
+
encoder.load_state_dict("mnist_encoder_weights.pt")
|
92 |
+
|
93 |
+
# Load an image of a handwritten digit.
|
94 |
+
# sample_image = (load your image here)
|
95 |
+
|
96 |
+
# Encode the loaded image
|
97 |
+
encoded_image = encode(sample_image)
|
98 |
+
outputs = model(encoded_image)
|
99 |
+
print(outputs)
|
100 |
+
```
|
101 |
+
|
102 |
+
## Training Details
|
103 |
+
|
104 |
+
### Training Data
|
105 |
+
|
106 |
+
<!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
107 |
+
|
108 |
+
[Link to MNIST will be added soon]
|
109 |
+
|
110 |
+
### Training Procedure
|
111 |
+
|
112 |
+
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
113 |
+
|
114 |
+
#### Preprocessing
|
115 |
+
|
116 |
+
[More Information Needed]
|
117 |
+
|
118 |
+
|
119 |
+
#### Training Hyperparameters
|
120 |
+
|
121 |
+
- **Training regime:** [I don't know yet] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
122 |
+
- **DIMENSIONS:** 11000
|
123 |
+
- **IMAGE SIZE:** 28
|
124 |
+
- **NUMBER OF LEVELS:** = 1000
|
125 |
+
- **BATCH SIZE:** 2
|
126 |
+
#### Speeds, Sizes, Times
|
127 |
+
|
128 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
129 |
+
|
130 |
+
The training of this model took 1 hour, because I have a potato PC
|
131 |
+
|
132 |
+
## Evaluation
|
133 |
+
|
134 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
135 |
+
|
136 |
+
### Testing Data, Factors & Metrics
|
137 |
+
|
138 |
+
#### Testing Data
|
139 |
+
|
140 |
+
<!-- This should link to a Data Card if possible. -->
|
141 |
+
|
142 |
+
[Link to MNIST will be added soon]
|
143 |
+
|
144 |
+
#### Factors
|
145 |
+
|
146 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
147 |
+
|
148 |
+
[More Information Needed]
|
149 |
+
|
150 |
+
#### Metrics
|
151 |
+
|
152 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
153 |
+
|
154 |
+
[Accuracy: 82.850%]
|
155 |
+
|
156 |
+
### Results
|
157 |
+
|
158 |
+
[More Information Needed]
|
159 |
+
|
160 |
+
#### Summary
|
161 |
+
|
162 |
+
This model is simply too inaccurate for its own good. However, I (Comrade Cat), will try to retrain the model until it has better accuracy.
|
163 |
+
|
164 |
+
## Model Card Contact
|
165 |
+
|
166 |
+
[More Information Needed]
|