Skip to content

Commit

Permalink
Add README to CNN examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lorne smith authored and lorne-maxim committed May 21, 2020
1 parent 381f424 commit b965c0f
Show file tree
Hide file tree
Showing 8 changed files with 749 additions and 30 deletions.
12 changes: 0 additions & 12 deletions Examples/MAX78000/CNN/README.md

This file was deleted.

24 changes: 21 additions & 3 deletions Examples/MAX78000/CNN/cats-vs-dogs-chw/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
## Description

TBD<!--TBD-->
This demo decides whether an image is a cat or a dog.

The code is auto-generated by the ai8x-synthesis tool and runs a known-answer
test with a pre-defined input sample. This example will be enhance with live capture and TFT
output in the near future.

## Required Connections

TBD<!--TBD-->
- Connect a USB cable between the PC and the CN1 (USB/PWR) connector.
- Connect pins 1 and 2 (P0_1) of the JH1 (UART 0 EN) header.
- Open an terminal application on the PC and connect to the EV kit's console UART at 115200, 8-N-1.

## Expected Output

TBD<!--TBD-->
The Console UART of the device will output these messages:

```
*** CNN Test ***
*** PASS ***
Time for CNN: 2526 us
Classification results:
[-13146] -> Class 0: 19.0%
[ 13227] -> Class 1: 79.0%
```

20 changes: 17 additions & 3 deletions Examples/MAX78000/CNN/cifar-10/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
## Description

TBD<!--TBD-->
CIFAR-10 is a simple object classification test, see https://en.wikipedia.org/wiki/CIFAR-10. The input size is 3x32x32.

The code is auto-generated by the ai8x-synthesis tool and runs a known-answer
test with a pre-defined input sample. This example will be enhance with live capture and TFT
output in the near future.

## Required Connections

TBD<!--TBD-->
- Connect a USB cable between the PC and the CN1 (USB/PWR) connector.
- Connect pins 1 and 2 (P0_1) of the JH1 (UART 0 EN) header.
- Open an terminal application on the PC and connect to the EV kit's console UART at 115200, 8-N-1.

## Expected Output

TBD<!--TBD-->
The Console UART of the device will output these messages:

```
*** CNN Test ***
*** PASS ***
Time for CNN: 1685 us
```

122 changes: 119 additions & 3 deletions Examples/MAX78000/CNN/cifar-100/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,128 @@
## Description

TBD<!--TBD-->
CIFAR-100 is a simple object classification test, using 100 different classes. The input size is 3x32x32.

The code is auto-generated by the ai8x-synthesis tool and runs a known-answer
test with a pre-defined input sample. This example will be enhance with live capture and TFT
output in the near future.

## Required Connections

TBD<!--TBD-->
- Connect a USB cable between the PC and the CN1 (USB/PWR) connector.
- Connect pins 1 and 2 (P0_1) of the JH1 (UART 0 EN) header.
- Open an terminal application on the PC and connect to the EV kit's console UART at 115200, 8-N-1.

## Expected Output

TBD<!--TBD-->
The Console UART of the device will output these messages:

```
*** CNN Test ***
*** PASS ***
Time for CNN: 2570 us
Classification results:
[ 35997] -> Class 0: 28.7%
[ -64813] -> Class 1: 0.4%
[-121777] -> Class 2: 0.0%
[-131153] -> Class 3: 0.0%
[-138095] -> Class 4: 0.0%
[ -69347] -> Class 5: 0.2%
[-115346] -> Class 6: 0.1%
[ -76513] -> Class 7: 0.2%
[-157312] -> Class 8: 0.0%
[ -77299] -> Class 9: 0.2%
[ -25727] -> Class 10: 1.8%
[-150924] -> Class 11: 0.0%
[-162090] -> Class 12: 0.0%
[-121492] -> Class 13: 0.0%
[-104610] -> Class 14: 0.1%
[ -97926] -> Class 15: 0.1%
[ -73847] -> Class 16: 0.2%
[-153786] -> Class 17: 0.0%
[ -67095] -> Class 18: 0.4%
[-106266] -> Class 19: 0.1%
[ -94020] -> Class 20: 0.1%
[-173073] -> Class 21: 0.0%
[-107865] -> Class 22: 0.1%
[ -89592] -> Class 23: 0.1%
[-114038] -> Class 24: 0.1%
[ -24653] -> Class 25: 1.8%
[-116263] -> Class 26: 0.1%
[-157031] -> Class 27: 0.0%
[ -54430] -> Class 28: 0.4%
[-106754] -> Class 29: 0.1%
[-176985] -> Class 30: 0.0%
[-134921] -> Class 31: 0.0%
[ -31922] -> Class 32: 1.8%
[ -71717] -> Class 33: 0.2%
[-153564] -> Class 34: 0.0%
[-173929] -> Class 35: 0.0%
[-114326] -> Class 36: 0.1%
[-143840] -> Class 37: 0.0%
[-203443] -> Class 38: 0.0%
[-101671] -> Class 39: 0.1%
[-120907] -> Class 40: 0.0%
[-160199] -> Class 41: 0.0%
[-198842] -> Class 42: 0.0%
[-140705] -> Class 43: 0.0%
[-106246] -> Class 44: 0.1%
[ -67912] -> Class 45: 0.4%
[-155456] -> Class 46: 0.0%
[ -41800] -> Class 47: 0.9%
[-228728] -> Class 48: 0.0%
[-119607] -> Class 49: 0.0%
[-106100] -> Class 50: 0.1%
[ -63703] -> Class 51: 0.4%
[-139052] -> Class 52: 0.0%
[ 2502] -> Class 53: 7.2%
[-122198] -> Class 54: 0.0%
[-132491] -> Class 55: 0.0%
[-114259] -> Class 56: 0.1%
[ 15489] -> Class 57: 14.3%
[-164336] -> Class 58: 0.0%
[-112811] -> Class 59: 0.1%
[ -40528] -> Class 60: 0.9%
[ -96538] -> Class 61: 0.1%
[ -53379] -> Class 62: 0.4%
[-125755] -> Class 63: 0.0%
[-196914] -> Class 64: 0.0%
[-125558] -> Class 65: 0.0%
[-219963] -> Class 66: 0.0%
[ -63646] -> Class 67: 0.4%
[ -32604] -> Class 68: 1.8%
[-114963] -> Class 69: 0.1%
[ -52485] -> Class 70: 0.9%
[ -61693] -> Class 71: 0.4%
[-127933] -> Class 72: 0.0%
[-119397] -> Class 73: 0.0%
[-150996] -> Class 74: 0.0%
[-194726] -> Class 75: 0.0%
[-125050] -> Class 76: 0.0%
[ -74555] -> Class 77: 0.2%
[-114428] -> Class 78: 0.1%
[-103334] -> Class 79: 0.1%
[-143704] -> Class 80: 0.0%
[-135457] -> Class 81: 0.0%
[ -31013] -> Class 82: 1.8%
[ 37491] -> Class 83: 28.7%
[ -86443] -> Class 84: 0.1%
[-189897] -> Class 85: 0.0%
[-121106] -> Class 86: 0.0%
[ -90377] -> Class 87: 0.1%
[-143171] -> Class 88: 0.0%
[-120577] -> Class 89: 0.0%
[-135003] -> Class 90: 0.0%
[ -71930] -> Class 91: 0.2%
[ -39165] -> Class 92: 0.9%
[-107021] -> Class 93: 0.1%
[ -60423] -> Class 94: 0.4%
[-147585] -> Class 95: 0.0%
[ -78406] -> Class 96: 0.2%
[-232354] -> Class 97: 0.0%
[-157146] -> Class 98: 0.0%
[ -63513] -> Class 99: 0.4%
```

44 changes: 41 additions & 3 deletions Examples/MAX78000/CNN/kws20/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
## Description

TBD<!--TBD-->
This demo classifies audio into one of 20 different keywords. It is trained with the 2nd version of Google's
speech commands dataset. This dataset consists of 35 keywords and more than 100K utterances.

The code is auto-generated by the ai8x-synthesis tool and runs a known-answer
test with a pre-defined input sample. This example will be enhance with live capture and TFT
output in the near future.

## Required Connections

TBD<!--TBD-->
- Connect a USB cable between the PC and the CN1 (USB/PWR) connector.
- Connect pins 1 and 2 (P0_1) of the JH1 (UART 0 EN) header.
- Open an terminal application on the PC and connect to the EV kit's console UART at 115200, 8-N-1.

## Expected Output

TBD<!--TBD-->
The Console UART of the device will output these messages:

```
*** CNN Test ***
*** PASS ***
Time for CNN: 1792 us
Classification results:
[-227748] -> Class 0: 0.0%
[-200184] -> Class 1: 0.0%
[-154269] -> Class 2: 0.1%
[ -94510] -> Class 3: 1.3%
[-223096] -> Class 4: 0.0%
[-177922] -> Class 5: 0.0%
[-253925] -> Class 6: 0.0%
[-214902] -> Class 7: 0.0%
[-129075] -> Class 8: 0.3%
[-240221] -> Class 9: 0.0%
[ 9379] -> Class 10: 82.6%
[-391897] -> Class 11: 0.0%
[-182153] -> Class 12: 0.0%
[ -52206] -> Class 13: 5.2%
[ -44969] -> Class 14: 10.3%
[-328764] -> Class 15: 0.0%
[-251813] -> Class 16: 0.0%
[-203954] -> Class 17: 0.0%
[-176528] -> Class 18: 0.0%
[-267346] -> Class 19: 0.0%
[-146511] -> Class 20: 0.1%
```

34 changes: 31 additions & 3 deletions Examples/MAX78000/CNN/mnist-riscv/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
## Description

TBD<!--TBD-->
This test is identical to the MNIST test, but runs using the RISC-V core instead of the ARM core.

This is the "Hello World" of machine learning. It uses the MNIST dataset of handwritten digits. See http://yann.lecun.com/exdb/mnist/. The input size is 28x28 pixels monochrome (i.e., 1x28x28 in CHW notation).

The code is auto-generated by the ai8x-synthesis tool and runs a known-answer
test with a pre-defined input sample. This example will be enhance with live capture and TFT
output in the near future.

## Required Connections

TBD<!--TBD-->
- Connect a USB cable between the PC and the CN1 (USB/PWR) connector.
- Connect pins 1 and 2 (P0_1) of the JH1 (UART 0 EN) header.
- Open an terminal application on the PC and connect to the EV kit's console UART at 115200, 8-N-1.

## Expected Output

TBD<!--TBD-->
The Console UART of the device will output these messages:

```
*** CNN Test ***
*** PASS ***
Time for CNN: 1333 us
Classification results:
[ -29649] -> Class 0: 4.2%
[ -25548] -> Class 1: 4.2%
[ -27429] -> Class 2: 4.2%
[ -25779] -> Class 3: 4.2%
[ -25914] -> Class 4: 4.2%
[ -38948] -> Class 5: 2.1%
[ -68083] -> Class 6: 0.5%
[ 39323] -> Class 7: 67.7%
[ -31039] -> Class 8: 4.2%
[ -28505] -> Class 9: 4.2%
```

32 changes: 29 additions & 3 deletions Examples/MAX78000/CNN/mnist/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
## Description

TBD<!--TBD-->
This is the "Hello World" of machine learning. It uses the MNIST dataset of handwritten digits. See http://yann.lecun.com/exdb/mnist/. The input size is 28x28 pixels monochrome (i.e., 1x28x28 in CHW notation).

The code is auto-generated by the ai8x-synthesis tool and runs a known-answer
test with a pre-defined input sample. This example will be enhance with live capture and TFT
output in the near future.

## Required Connections

TBD<!--TBD-->
- Connect a USB cable between the PC and the CN1 (USB/PWR) connector.
- Connect pins 1 and 2 (P0_1) of the JH1 (UART 0 EN) header.
- Open an terminal application on the PC and connect to the EV kit's console UART at 115200, 8-N-1.

## Expected Output

TBD<!--TBD-->
The Console UART of the device will output these messages:

```
*** CNN Test ***
*** PASS ***
Time for CNN: 1386 us
Classification results:
[ -29649] -> Class 0: 4.2%
[ -25548] -> Class 1: 4.2%
[ -27429] -> Class 2: 4.2%
[ -25779] -> Class 3: 4.2%
[ -25914] -> Class 4: 4.2%
[ -38948] -> Class 5: 2.1%
[ -68083] -> Class 6: 0.5%
[ 39323] -> Class 7: 67.7%
[ -31039] -> Class 8: 4.2%
[ -28505] -> Class 9: 4.2%
```

Loading

0 comments on commit b965c0f

Please sign in to comment.