Skip to content

Commit 6aa1334

Browse files
authored
Change CIFAR-10, CIFAR-100 examples to NAS-derived models (#116)
1 parent a20508a commit 6aa1334

9 files changed

+21219
-42276
lines changed

gen-demos-max78000.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ COMMON_ARGS="--device $DEVICE --compact-data --mexpress --timer 0 --display-chec
55

66
./ai8xize.py --verbose --log --test-dir $TARGET --prefix mnist --checkpoint-file trained/ai85-mnist-qat8-q.pth.tar --config-file networks/mnist-chw-ai85.yaml --softmax $COMMON_ARGS "$@"
77
./ai8xize.py --verbose --log --test-dir $TARGET --prefix mnist-riscv --checkpoint-file trained/ai85-mnist-qat8-q.pth.tar --config-file networks/mnist-chw-ai85.yaml --softmax $COMMON_ARGS --riscv --riscv-debug "$@"
8-
./ai8xize.py --verbose --log --test-dir $TARGET --prefix cifar-10 --checkpoint-file trained/ai85-cifar10-qat8-q.pth.tar --config-file networks/cifar10-hwc-ai85.yaml --softmax $COMMON_ARGS "$@"
9-
./ai8xize.py --verbose --log --test-dir $TARGET --prefix cifar-100 --checkpoint-file trained/ai85-cifar100-qat8-q.pth.tar --config-file networks/cifar100-simple.yaml --softmax $COMMON_ARGS --boost 2.5 "$@"
8+
./ai8xize.py --verbose --log --test-dir $TARGET --prefix cifar-10 --checkpoint-file trained/ai85-cifar10-qat8-q.pth.tar --config-file networks/cifar10-nas.yaml --sample-input tests/sample_cifar-10.npy --softmax $COMMON_ARGS "$@"
9+
./ai8xize.py --verbose --log --test-dir $TARGET --prefix cifar-100 --checkpoint-file trained/ai85-cifar100-qat8-q.pth.tar --config-file networks/cifar100-nas.yaml --softmax $COMMON_ARGS --boost 2.5 "$@"
1010
./ai8xize.py --verbose --log --test-dir $TARGET --prefix cifar-100-mixed --checkpoint-file trained/ai85-cifar100-qat-mixed-q.pth.tar --config-file networks/cifar100-simple.yaml --softmax $COMMON_ARGS --boost 2.5 "$@"
1111
./ai8xize.py --verbose --log --test-dir $TARGET --prefix cifar-100-simplewide2x-mixed --checkpoint-file trained/ai85-cifar100-simplenetwide2x-qat-mixed-q.pth.tar --config-file networks/cifar100-simplewide2x.yaml --softmax $COMMON_ARGS --boost 2.5 "$@"
1212
./ai8xize.py --verbose --log --test-dir $TARGET --prefix cifar-100-residual --checkpoint-file trained/ai85-cifar100-residual-qat8-q.pth.tar --config-file networks/cifar100-ressimplenet.yaml --softmax $COMMON_ARGS --boost 2.5 "$@"

networks/cifar10-nas.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# HWC (little data) configuration for CIFAR10 NAS Model
2+
# Simple Model
3+
4+
arch: ai85nascifarnet
5+
dataset: CIFAR10
6+
7+
layers:
8+
- out_offset: 0x4000
9+
processors: 0x0000000000000007 #1_1
10+
operation: conv2d
11+
kernel_size: 3x3
12+
pad: 1
13+
activate: ReLU
14+
data_format: HWC
15+
- out_offset: 0x0000
16+
processors: 0xffffffffffffffff #1_2
17+
operation: conv2d
18+
kernel_size: 1x1
19+
pad: 0
20+
activate: ReLU
21+
- out_offset: 0x4000
22+
processors: 0x00000000ffffffff #1_3
23+
operation: conv2d
24+
kernel_size: 3x3
25+
pad: 1
26+
activate: ReLU
27+
- max_pool: 2
28+
pool_stride: 2
29+
out_offset: 0x0000
30+
processors: 0xffffffffffffffff #2_1
31+
operation: conv2d
32+
kernel_size: 3x3
33+
pad: 1
34+
activate: ReLU
35+
- out_offset: 0x4000
36+
processors: 0xffffffff00000000 #2_2
37+
operation: conv2d
38+
kernel_size: 1x1
39+
pad: 0
40+
activate: ReLU
41+
- max_pool: 2
42+
pool_stride: 2
43+
out_offset: 0x0000
44+
processors: 0xffffffffffffffff #3_1
45+
operation: conv2d
46+
kernel_size: 3x3
47+
pad: 1
48+
activate: ReLU
49+
- out_offset: 0x4000
50+
processors: 0xffffffffffffffff #3_2
51+
operation: conv2d
52+
kernel_size: 1x1
53+
pad: 0
54+
activate: ReLU
55+
- max_pool: 2
56+
pool_stride: 2
57+
out_offset: 0x0000
58+
processors: 0xffffffffffffffff #4_1
59+
operation: conv2d
60+
kernel_size: 3x3
61+
pad: 1
62+
activate: ReLU
63+
- out_offset: 0x4000
64+
processors: 0xffffffffffffffff #4_2
65+
operation: conv2d
66+
kernel_size: 3x3
67+
pad: 1
68+
activate: ReLU
69+
- max_pool: 2
70+
pool_stride: 2
71+
out_offset: 0x0000
72+
processors: 0xffffffffffffffff #5_1
73+
operation: conv2d
74+
kernel_size: 1x1
75+
pad: 0
76+
activate: ReLU
77+
- flatten: true
78+
out_offset: 0x4000
79+
processors: 0xffffffffffffffff
80+
operation: MLP
81+
output_width: 32

networks/cifar100-nas.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# HWC (little data) configuration for CIFAR100 NAS Model
2+
# Simple Model
3+
4+
arch: ai85nascifarnet
5+
dataset: CIFAR100
6+
7+
layers:
8+
- out_offset: 0x4000
9+
processors: 0x0000000000000007 #1_1
10+
operation: conv2d
11+
kernel_size: 3x3
12+
pad: 1
13+
activate: ReLU
14+
data_format: HWC
15+
- out_offset: 0x0000
16+
processors: 0xffffffffffffffff #1_2
17+
operation: conv2d
18+
kernel_size: 1x1
19+
pad: 0
20+
activate: ReLU
21+
- out_offset: 0x4000
22+
processors: 0x00000000ffffffff #1_3
23+
operation: conv2d
24+
kernel_size: 3x3
25+
pad: 1
26+
activate: ReLU
27+
- max_pool: 2
28+
pool_stride: 2
29+
out_offset: 0x0000
30+
processors: 0xffffffffffffffff #2_1
31+
operation: conv2d
32+
kernel_size: 3x3
33+
pad: 1
34+
activate: ReLU
35+
- out_offset: 0x4000
36+
processors: 0xffffffff00000000 #2_2
37+
operation: conv2d
38+
kernel_size: 1x1
39+
pad: 0
40+
activate: ReLU
41+
- max_pool: 2
42+
pool_stride: 2
43+
out_offset: 0x0000
44+
processors: 0xffffffffffffffff #3_1
45+
operation: conv2d
46+
kernel_size: 3x3
47+
pad: 1
48+
activate: ReLU
49+
- out_offset: 0x4000
50+
processors: 0xffffffffffffffff #3_2
51+
operation: conv2d
52+
kernel_size: 1x1
53+
pad: 0
54+
activate: ReLU
55+
- max_pool: 2
56+
pool_stride: 2
57+
out_offset: 0x0000
58+
processors: 0xffffffffffffffff #4_1
59+
operation: conv2d
60+
kernel_size: 3x3
61+
pad: 1
62+
activate: ReLU
63+
- out_offset: 0x4000
64+
processors: 0xffffffffffffffff #4_2
65+
operation: conv2d
66+
kernel_size: 3x3
67+
pad: 1
68+
activate: ReLU
69+
- max_pool: 2
70+
pool_stride: 2
71+
out_offset: 0x0000
72+
processors: 0xffffffffffffffff #5_1
73+
operation: conv2d
74+
kernel_size: 1x1
75+
pad: 0
76+
activate: ReLU
77+
- flatten: true
78+
out_offset: 0x4000
79+
processors: 0xffffffffffffffff
80+
operation: MLP
81+
output_width: 32

trained/ai85-cifar10-qat8-q.pth.tar

2.94 MB
Binary file not shown.

0 commit comments

Comments
 (0)