Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Autoencoder Model #329

Merged
merged 6 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions networks/ai85-autoencoder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
arch: ai85autoencoder
dataset: SampleMotorDataLimerick
# Define layer parameters in order of the layer sequence
layers:
# Layer 0: 256 channels in --> 64 processors, 4 passes. Conv1D
- pad: 0
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
operation: Conv1d
kernel_size: 1
data_format: HWC
# Layer 1: 128 channels in --> 64 processors, 2 passes. Conv1D
- pad: 0
activate: ReLU
out_offset: 0x0000
processors: 0xffffffffffffffff
kernel_size: 3
operation: Conv1d
# Layer 2: 64 inputs --> 64 processors, 1 passes. MLP
- pad: 0
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
operation: MLP
# Layer 3: 32 inputs --> 32 processors, 1 pass. MLP
- activate: ReLU
out_offset: 0x0000
processors: 0x00000000ffffffff
operation: MLP
# Layer 4: 16 inputs --> 16 processors, 1 pass. MLP
- activate: ReLU
out_offset: 0x2000
processors: 0x000000000000000f
operation: MLP
# Layer 5: 32 inputs --> 32 processors, 1 pass. MLP
- activate: ReLU
out_offset: 0x4000
processors: 0x00000000ffffffff
operation: MLP
# Layer 6: 96 inputs --> 48 processors, 2 passes. MLP
- pad: 0
activate: None
out_offset: 0x0000
processors: 0x0000ffffffffffff
operation: MLP
6 changes: 6 additions & 0 deletions scripts/gen_autoencoder_max78000.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
DEVICE="MAX78000"
TARGET="sdk/Examples/$DEVICE/CNN"
COMMON_ARGS="--device $DEVICE --timer 0 --display-checkpoint --verbose"

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 "$@"
2 changes: 2 additions & 0 deletions scripts/quantize_autoencoder_max78000.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
python quantize.py trained/ai85-autoencoder-samplemotordatalimerick-qat.pth.tar trained/ai85-autoencoder-samplemotordatalimerick-qat-q.pth.tar --device MAX78000 "$@"
Binary file added tests/sample_motordatalimerick_fortrain.npy
Binary file not shown.
Binary file not shown.
Binary file not shown.
7,618 changes: 7,618 additions & 0 deletions trained/ai85-autoencoder-samplemotordatalimerick.log

Large diffs are not rendered by default.