Skip to content

Commit

Permalink
feat: Add apnea demo.
Browse files Browse the repository at this point in the history
feat: Latest hw results.
  • Loading branch information
apage224 committed Apr 15, 2024
1 parent fe4e86b commit 9ecbc7c
Show file tree
Hide file tree
Showing 23 changed files with 327 additions and 660 deletions.
103 changes: 0 additions & 103 deletions configs/sa-2-tcn-lg.json

This file was deleted.

31 changes: 14 additions & 17 deletions configs/sa-2-tcn-sm.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
},
"sampling_rate": 1,
"frame_size": 3600,
"frame_size": 600,
"model_file": "model.keras",
"num_classes": 2,
"class_map": {
Expand All @@ -22,17 +22,17 @@
"4": 1
},
"class_names": ["NONE", "APNEA"],
"samples_per_subject": 40,
"val_samples_per_subject": 40,
"samples_per_subject": 80,
"val_samples_per_subject": 80,
"val_subjects": 0.20,
"val_size": 12000,
"val_size": 24000,
"val_acc_threshold": 0.98,
"test_size": 15000,
"test_samples_per_subject": 40,
"test_size": 30000,
"test_samples_per_subject": 80,
"batch_size": 256,
"buffer_size": 40000,
"buffer_size": 80000,
"epochs": 125,
"steps_per_epoch": 50,
"steps_per_epoch": 100,
"val_metric": "loss",
"lr_rate": 1e-3,
"lr_cycles": 1,
Expand All @@ -50,17 +50,14 @@
"architecture": {
"name": "tcn",
"params": {
"input_kernel": [1, 7],
"input_norm": "batch",
"block_type": "mb",
"blocks": [
{"depth": 1, "branch": 1, "filters": 8, "kernel": [1, 7], "dilation": [1, 1], "dropout": 0, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 12, "kernel": [1, 7], "dilation": [1, 2], "dropout": 0, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 16, "kernel": [1, 7], "dilation": [1, 4], "dropout": 0, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 20, "kernel": [1, 7], "dilation": [1, 8], "dropout": 0, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 24, "kernel": [1, 7], "dilation": [1, 16], "dropout": 0, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 28, "kernel": [1, 7], "dilation": [1, 32], "dropout": 0, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 32, "kernel": [1, 7], "dilation": [1, 64], "dropout": 0, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 40, "kernel": [1, 7], "dilation": [1, 128], "dropout": 0, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"}
{"depth": 1, "branch": 1, "filters": 16, "kernel": [1, 7], "dilation": [1, 2], "dropout": 0, "ex_ratio": 1, "se_ratio": 2, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 24, "kernel": [1, 7], "dilation": [1, 4], "dropout": 0, "ex_ratio": 1, "se_ratio": 4, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 32, "kernel": [1, 7], "dilation": [1, 8], "dropout": 0, "ex_ratio": 1, "se_ratio": 4, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 40, "kernel": [1, 7], "dilation": [1, 16], "dropout": 0, "ex_ratio": 1, "se_ratio": 4, "norm": "batch"},
{"depth": 1, "branch": 1, "filters": 48, "kernel": [1, 7], "dilation": [1, 32], "dropout": 0, "ex_ratio": 1, "se_ratio": 4, "norm": "batch"}
],
"output_kernel": [1, 7],
"include_top": true,
Expand Down
66 changes: 0 additions & 66 deletions configs/sa-2-unet-lg.json

This file was deleted.

2 changes: 1 addition & 1 deletion configs/ss-2-tcn-sm.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"mask_key": "mask"
}
},
"sampling_rate": 32,
"sampling_rate": 0.03333,
"frame_size": 240,
"model_file": "model.keras",
"num_classes": 2,
Expand Down
2 changes: 1 addition & 1 deletion configs/ss-3-tcn-sm.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"mask_key": "mask"
}
},
"sampling_rate": 32,
"sampling_rate": 0.03333,
"frame_size": 240,
"model_file": "model.keras",
"num_classes": 3,
Expand Down
6 changes: 3 additions & 3 deletions configs/ss-4-tcn-sm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ss-4-tcn-lg",
"job_dir": "./results/ss-4-tcn-lg",
"name": "ss-4-tcn-sm",
"job_dir": "./results/ss-4-tcn-sm",
"ds_path": "./datasets/store/fs-w-pa-14-60/mesa",
"dataset": {
"name": "hdf5",
Expand All @@ -10,7 +10,7 @@
"mask_key": "mask"
}
},
"sampling_rate": 32,
"sampling_rate": 0.03333,
"frame_size": 240,
"model_file": "model.keras",
"num_classes": 4,
Expand Down
2 changes: 1 addition & 1 deletion configs/ss-5-tcn-sm.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"mask_key": "mask"
}
},
"sampling_rate": 32,
"sampling_rate": 0.03333,
"frame_size": 240,
"model_file": "model.keras",
"num_classes": 5,
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/zoo/apnea/apnea-model-hw-table.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
| Name | Params | FLOPS | Metric | Time | Arena | Energy |
| --------------- | -------- | ------- | ---------- | -------- | ----- | ---------- |
| SA-2-UNET-LG | 62K | 33M/hr | 91.0% F1 | 780ms/hr | 70KB | 12.8mJ/hr |
| __SA-2-TCN-SM__ | 10K | 44M/hr | 91.0% F1 | 1.8s/hr | 61KB | 17.0mJ/hr |
2 changes: 1 addition & 1 deletion docs/assets/zoo/apnea/apnea-model-zoo-table.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
| NAME | LOCATION | # CLASSES | MODEL | PARAMS | FLOPS | ACCURACY | F1 |
| ---------------- | -------- | --------- | ------- | ------ | ------- | -------- | ----- |
| __SA-2-UNET-LG__ | Wrist | 2 | U-NET | 61K | 33M/hr | 91.0% | 91.0% |
| __SA-2-TCN-SM__ | Wrist | 2 | TCN | 5K | 20M/hr | 91.0% | 91.0% |
Loading

0 comments on commit 9ecbc7c

Please sign in to comment.