Skip to content

Commit 966b4af

Browse files
authored
Add Autoencoder Model (#329)
1 parent ebcb8aa commit 966b4af

7 files changed

+7677
-0
lines changed

Diff for: networks/ai85-autoencoder.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
# Autoencoder model compatible with MAX78000.
3+
# Input Shape: [256, 3] = [N_CHANNELS, SIGNAL_LEN]
4+
# Sample motor data is collected using SpectraQuest Machinery Fault Simulator.
5+
6+
arch: ai85autoencoder
7+
dataset: SampleMotorDataLimerick
8+
9+
layers:
10+
# Layer 0: 256 channels in --> 64 processors, 4 passes. Conv1D
11+
- pad: 0
12+
activate: ReLU
13+
out_offset: 0x2000
14+
processors: 0xffffffffffffffff
15+
operation: Conv1d
16+
kernel_size: 1
17+
data_format: HWC
18+
# Layer 1: 128 channels in --> 64 processors, 2 passes. Conv1D
19+
- pad: 0
20+
activate: ReLU
21+
out_offset: 0x0000
22+
processors: 0xffffffffffffffff
23+
kernel_size: 3
24+
operation: Conv1d
25+
# Layer 2: 64 inputs --> 64 processors, 1 passes. MLP
26+
- pad: 0
27+
activate: ReLU
28+
out_offset: 0x2000
29+
processors: 0xffffffffffffffff
30+
operation: MLP
31+
# Layer 3: 32 inputs --> 32 processors, 1 pass. MLP
32+
- activate: ReLU
33+
out_offset: 0x0000
34+
processors: 0x00000000ffffffff
35+
operation: MLP
36+
# Layer 4: 16 inputs --> 16 processors, 1 pass. MLP
37+
- activate: ReLU
38+
out_offset: 0x2000
39+
processors: 0x000000000000000f
40+
operation: MLP
41+
# Layer 5: 32 inputs --> 32 processors, 1 pass. MLP
42+
- activate: ReLU
43+
out_offset: 0x4000
44+
processors: 0x00000000ffffffff
45+
operation: MLP
46+
# Layer 6: 96 inputs --> 48 processors, 2 passes. MLP
47+
- pad: 0
48+
activate: None
49+
out_offset: 0x0000
50+
processors: 0x0000ffffffffffff
51+
operation: MLP

Diff for: scripts/gen_autoencoder_max78000.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
DEVICE="MAX78000"
3+
TARGET="sdk/Examples/$DEVICE/CNN"
4+
COMMON_ARGS="--device $DEVICE --timer 0 --display-checkpoint --verbose"
5+
6+
python ai8xize.py --test-dir $TARGET --prefix autoencoder --checkpoint-file trained/ai85-autoencoder-samplemotordatalimerick-qat-q.pth.tar --config-file networks/ai85-autoencoder.yaml --sample-input tests/sample_motordatalimerick_fortrain.npy --energy $COMMON_ARGS "$@"

Diff for: scripts/quantize_autoencoder_max78000.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
python quantize.py trained/ai85-autoencoder-samplemotordatalimerick-qat.pth.tar trained/ai85-autoencoder-samplemotordatalimerick-qat-q.pth.tar --device MAX78000 "$@"

Diff for: tests/sample_motordatalimerick_fortrain.npy

6.13 KB
Binary file not shown.
1.59 MB
Binary file not shown.
1.6 MB
Binary file not shown.

Diff for: trained/ai85-autoencoder-samplemotordatalimerick.log

+7,618
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)