-
Notifications
You must be signed in to change notification settings - Fork 62
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 NAS KWS model (trained using dynamic augmentation) #324
Merged
rotx-eva
merged 8 commits into
analogdevicesinc:develop
from
alicangok:kws/dynamicaug_nas
Feb 1, 2024
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a4bd40f
Add NAS KWS model, trained using dynamic augmentation
alicangok c17737a
Add the training log
alicangok bc21d2f
Merge branch 'develop' into kws/dynamicaug_nas
rotx-eva 3a46729
Add v2, v3, NAS checkpoints trained using dynamic augmentation (bette…
alicangok b4a5096
Merge branch 'kws/dynamicaug_nas' of github.com:alicangok/ai8x-synthe…
alicangok df68d2b
Modify copyright texts
alicangok ae9c477
Remove the Apache licence texts from cnn.h and main.c templates
alicangok e05d3a5
Merge branch 'develop' into kws/dynamicaug_nas
rotx-eva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
# HWC (big data) configuration for ai85kws20netnas | ||
|
||
arch: ai85kws20netnas | ||
dataset: KWS_20 | ||
|
||
# Define layer parameters in order of the layer sequence | ||
layers: | ||
# Conv 1D - 14 layers | ||
# Unit-1 | ||
- data_format: HWC | ||
operation: Conv1d | ||
kernel_size: 1 | ||
pad: 0 | ||
activate: ReLU | ||
out_offset: 0x2000 | ||
processors: 0xffffffffffffffff | ||
- operation: Conv1d | ||
kernel_size: 3 | ||
pad: 1 | ||
activate: ReLU | ||
out_offset: 0x0000 | ||
processors: 0xffffffffffffffff | ||
- operation: Conv1d | ||
kernel_size: 3 | ||
pad: 1 | ||
activate: ReLU | ||
out_offset: 0x2000 | ||
processors: 0xffffffffffffffff | ||
# Unit-2 | ||
- max_pool: 2 | ||
pool_stride: 2 | ||
operation: Conv1d | ||
kernel_size: 3 | ||
pad: 1 | ||
activate: ReLU | ||
out_offset: 0x0000 | ||
processors: 0xffffffffffffffff | ||
- operation: Conv1d | ||
kernel_size: 1 | ||
pad: 0 | ||
activate: ReLU | ||
out_offset: 0x2000 | ||
processors: 0xffffffffffffffff | ||
- operation: Conv1d | ||
kernel_size: 1 | ||
pad: 0 | ||
activate: ReLU | ||
out_offset: 0x0000 | ||
processors: 0xffffffffffffffff | ||
# Unit-3 | ||
- max_pool: 2 | ||
pool_stride: 2 | ||
operation: Conv1d | ||
kernel_size: 3 | ||
pad: 1 | ||
activate: ReLU | ||
out_offset: 0x2000 | ||
processors: 0xffffffffffffffff | ||
- operation: Conv1d | ||
kernel_size: 5 | ||
pad: 2 | ||
activate: ReLU | ||
out_offset: 0x0000 | ||
processors: 0xffffffffffffffff | ||
# Unit-4 | ||
- max_pool: 2 | ||
pool_stride: 2 | ||
operation: Conv1d | ||
kernel_size: 5 | ||
pad: 2 | ||
activate: ReLU | ||
out_offset: 0x2000 | ||
processors: 0xffffffffffffffff | ||
- operation: Conv1d | ||
kernel_size: 1 | ||
pad: 0 | ||
activate: ReLU | ||
out_offset: 0x0000 | ||
processors: 0xffffffffffffffff | ||
# Unit-5 | ||
- max_pool: 2 | ||
pool_stride: 2 | ||
operation: Conv1d | ||
kernel_size: 5 | ||
pad: 2 | ||
activate: ReLU | ||
out_offset: 0x2000 | ||
processors: 0xffffffffffffffff | ||
- operation: Conv1d | ||
kernel_size: 3 | ||
pad: 1 | ||
activate: ReLU | ||
out_offset: 0x0000 | ||
processors: 0xffffffffffffffff | ||
# Unit-6 | ||
- max_pool: 2 | ||
pool_stride: 2 | ||
operation: Conv1d | ||
kernel_size: 5 | ||
pad: 2 | ||
activate: ReLU | ||
out_offset: 0x2000 | ||
processors: 0xffffffffffffffff | ||
- operation: Conv1d | ||
kernel_size: 1 | ||
pad: 0 | ||
activate: ReLU | ||
out_offset: 0x0000 | ||
processors: 0xffffffffffffffff | ||
# Classification layer | ||
- flatten: true | ||
out_offset: 0x2000 | ||
processors: 0xffffffffffffffff | ||
operation: MLP | ||
output_width: 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 kws20_nas --checkpoint-file trained/ai85-kws20_nas-qat8-q.pth.tar --config-file networks/kws20-nas-hwc.yaml --softmax $COMMON_ARGS "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
python quantize.py trained/ai85-kws20_nas-qat8.pth.tar trained/ai85-kws20_nas-qat8-q.pth.tar --device MAX78000 -v "$@" |
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to rename the KWS20_v3 and KWS20_nas models as kws_light and kws? We can also remove the v1 & v2 models...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The demo, the KAT example, and
arch
fields in the model files and trained checkpoints) refers to the model as "v3" in multiple places, so we would need make the changes to all at the same time.I would suggest holding off on this until for a few weeks until we finalize the frequency-domain model, then decide on long-term names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Thanks...