You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All internal data are stored in HWC format, 4 channels per 32-bit word. Assuming 3-color (or 3-channel) input, one byte will be unused. Example:
612
+
All internal data are stored in HWC format, 4 channels per 32-bit word. Assuming 3-color (or 3-channel) input, one byte will be unused. The highest frequency in this data format is the channel, so the channels are interleaved.
613
+
614
+
Example:
613
615
614
616

615
617
616
618
#### CHW
617
619
618
-
The input layer can alternatively also use the CHW format (sequence of channels), for example:
620
+
The input layer can alternatively also use the CHW format (a sequence of channels). The highest frequency in this data format is the width or X-axis (W), and the lowest frequency is the channel. Assuming an RGB input, all red pixels are followed by all green pixels, followed by all blue pixels.
621
+
622
+
Example:
619
623
620
624

621
625
@@ -780,6 +784,8 @@ The `ai84net.py` and `ai85net.py` files contain models that fit into AI84’s we
780
784
781
785
To train the FP32 model for MNIST on MAX78000, run `scripts/train_mnist.sh` from the `ai8x-training` project. This script will place checkpoint files into the log directory. Training makes use of the Distiller framework, but the `train.py` software has been modified slightly to improve it and add some MAX78000/MAX78002 specifics.
782
786
787
+
Since training can take hours or days, the training script does not overwrite any weights previously produced. Results are placed in sub-directories under `logs/` named with date and time when training began. The latest results are always soft-linked to by `latest-log_dir` and `latest_log_file`.
788
+
783
789
### Command Line Arguments
784
790
785
791
The following table describes the most important command line arguments for `train.py`. Use `--help` for a complete list.
@@ -790,7 +796,7 @@ The following table describes the most important command line arguments for `tra
790
796
|*Device selection*|||
791
797
|`--device`| Set device (default: AI84) |`--device MAX78000`|
792
798
|*Model and dataset*|||
793
-
|`-a`, `--arch`| Set model (collected from models folder) |`--model ai85net5`|
799
+
|`-a`, `--arch`, `--model`| Set model (collected from models folder) |`--model ai85net5`|
794
800
|`--dataset`| Set dataset (collected from datasets folder) |`--dataset MNIST`|
795
801
|`--data`| Path to dataset (default: data) |`--data /data/ml`|
796
802
|*Training*|||
@@ -802,6 +808,7 @@ The following table describes the most important command line arguments for `tra
802
808
|`--resume-from`| Resume from previous checkpoint |`--resume-from chk.pth.tar`|
803
809
|`--qat-policy`| Define QAT policy in YAML file (default: qat_policy.yaml). Use ‘’None” to disable QAT. |`--qat-policy qat_policy.yaml`|
804
810
|*Display and statistics*|||
811
+
|`--enable-tensorboard`| Enable logging to TensorBoard (default: disabled) ||
@@ -941,7 +948,7 @@ Both TensorBoard and Manifold can be used for model comparison and feature attri
941
948
942
949
#### TensorBoard
943
950
944
-
TensorBoard is built into `train.py`. It provides a local web server that can be started before, during, or after training and it picks up all data that is written to the `logs/` directory.
951
+
TensorBoard is built into `train.py`. When enabled using `--enable-tensorboard`, it provides a local web server that can be started before, during, or after training and it picks up all data that is written to the `logs/` directory.
945
952
946
953
For classification models, TensorBoard supports the optional `--param-hist` and `--embedding` command line arguments. `--embedding` randomly selects up to 100 data points from the last batch of each verification epoch. These can be viewed in the “projector” tab in TensorBoard.
947
954
@@ -1169,6 +1176,7 @@ The following table describes the most important command line arguments for `ai8
1169
1176
|`--prefix`| Set test name prefix |`--prefix mnist`|
1170
1177
|`--board-name`| Set the target board (default: `EvKit_V1`) |`--board-name FTHR_RevA`|
1171
1178
|*Code generation*|||
1179
+
|`--overwrite`| Produce output even when the target directory exists (default: abort) ||
1172
1180
|`--compact-data`| Use *memcpy* to load input data in order to save code space ||
1173
1181
|`--compact-weights`| Use *memcpy* to load weights in order to save code space ||
1174
1182
|`--mexpress`| Use faster kernel loading ||
@@ -1227,6 +1235,8 @@ The following table describes the most important command line arguments for `ai8
1227
1235
1228
1236
### YAML Network Description
1229
1237
1238
+
The [quick-start guide](https://github.com/MaximIntegratedAI/MaximAI_Documentation/blob/master/Guides/YAML%20Quickstart.md) provides a short overview of the purpose and structure of the YAML network description file.
1239
+
1230
1240
An example network description for the ai85net5 architecture and MNIST is shown below:
1231
1241
1232
1242
```yaml
@@ -1422,7 +1432,7 @@ Example:
1422
1432
1423
1433
##### `activate` (Optional)
1424
1434
1425
-
This key describes whether to activate the layer output (the default is to not activate). When specified, this key must be `ReLU`, `Abs` or `None` (the default).
1435
+
This key describes whether to activate the layer output (the default is to not activate). When specified, this key must be `ReLU`, `Abs` or `None` (the default). *Please note that there is always an implicit non-linearity when outputting 8-bit data since outputs are clamped to $[–1, +127/128]$ during training.*
1426
1436
1427
1437
Note that the output values are clipped (saturated) to $[0, +127]$. Because of this, `ReLU` behaves more similar to PyTorch’s `nn.Hardtanh(min_value=0, max_value=127)` than to PyTorch’s `nn.ReLU()`.
0 commit comments