Skip to content

Commit

Permalink
feat: Remove evb code.
Browse files Browse the repository at this point in the history
feat: Update model zoo.
feat: Add eRPC python code.
feat: Update docs with latest results.
  • Loading branch information
apage224 committed Apr 24, 2024
1 parent 58b2d45 commit e4bfaab
Show file tree
Hide file tree
Showing 1,807 changed files with 4,556 additions and 1,149,391 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
- name: Install Poetry
run: pipx install poetry
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'
- name: Install and Build 🔧
run: |
poetry build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -43,9 +43,9 @@ jobs:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
# - name: Publish to PyPI 📦
# uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish to PyPI 📦
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ repos:
language: system
types: [python]
- repo: https://github.com/python-poetry/poetry
rev: 1.7.1
rev: 1.8.2
hooks:
- id: poetry-check
22 changes: 11 additions & 11 deletions configs/rhythm-class-2.json → configs/arr-2-eff-sm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rhythm-class-2",
"job_dir": "./results/rhythm-class-2-k9",
"name": "arr-2-eff-sm",
"job_dir": "./results/arr-2-eff-sm",
"ds_path": "./datasets",
"datasets": [{
"name": "icentia11k",
Expand All @@ -22,24 +22,24 @@
"NONE", "AFIB/AFL"
],
"sampling_rate": 100,
"frame_size": 400,
"frame_size": 512,
"model_file": "model.keras",
"samples_per_patient": [10, 20],
"samples_per_patient": [10, 10],
"val_samples_per_patient": [10, 10],
"val_file": "./results/${task}-class-2-${dataset}-${sampling_rate}fs-${frame_size}sz.pkl",
"test_file": "./results/${task}-class-2-${dataset}-${sampling_rate}fs-${frame_size}sz.pkl",
"val_samples_per_patient": [10, 20],
"val_patients": 0.20,
"threshold": 0.75,
"test_samples_per_patient": [5, 50],
"test_samples_per_patient": [10, 10],
"test_size": 40000,
"batch_size": 256,
"buffer_size": 100000,
"epochs": 125,
"steps_per_epoch": 20,
"epochs": 150,
"steps_per_epoch": 50,
"val_metric": "loss",
"lr_rate": 1e-3,
"lr_cycles": 1,
"class_weights": "fixed",
"class_weights": "balanced",
"threshold": 0.75,
"val_acc_threshold": 0.98,
"tflm_var_name": "g_rhythm_model",
"tflm_file": "rhythm_model_buffer.h",
Expand Down Expand Up @@ -79,7 +79,7 @@
"input_strides": [1, 2],
"blocks": [
{"filters": 24, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 32, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 32, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 40, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 48, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2}
],
Expand Down
18 changes: 9 additions & 9 deletions configs/rhythm-class-4.json → configs/arr-4-eff-sm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rhythm-class-4",
"job_dir": "./results/rhythm-class-4-k9-xl-lsad",
"name": "arr-4-eff-sm",
"job_dir": "./results/arr-4-eff-sm",
"ds_path": "./datasets",
"datasets": [{
"name": "lsad",
Expand All @@ -20,24 +20,24 @@
"SR", "SB", "AFIB", "GSVT"
],
"sampling_rate": 100,
"frame_size": 800,
"frame_size": 512,
"model_file": "model.keras",
"samples_per_patient": [5, 5, 5, 10],
"val_file": "./results/${task}-class-4-${dataset}-${sampling_rate}fs-${frame_size}sz.pkl",
"test_file": "./results/${task}-class-4-${dataset}-${sampling_rate}fs-${frame_size}sz.pkl",
"val_samples_per_patient": [5, 5, 5, 10],
"val_patients": 0.20,
"threshold": 0.5,
"test_samples_per_patient": [5, 5, 5, 10],
"test_size": 20000,
"batch_size": 128,
"buffer_size": 40000,
"epochs": 125,
"test_size": 50000,
"batch_size": 256,
"buffer_size": 100000,
"epochs": 150,
"steps_per_epoch": 50,
"val_metric": "loss",
"lr_rate": 1e-3,
"lr_cycles": 1,
"class_weights": "fixed",
"class_weights": "balanced",
"threshold": 0.5,
"val_acc_threshold": 0.98,
"tflm_var_name": "g_rhythm_model",
"tflm_file": "rhythm_model_buffer.h",
Expand Down
46 changes: 21 additions & 25 deletions configs/diagnostic-class-2.json → configs/beat-2-eff-sm.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
{
"name": "diagnostic-class-2-lsad",
"job_dir": "./results/diagnostic-class-2-lsad",
"name": "bc-2-eff-sm",
"job_dir": "./results/bc-2-eff-sm",
"ds_path": "./datasets",
"datasets": [{
"name": "lsad",
"name": "icentia11k",
"params": {}
}],
"num_classes": 2,
"class_map": {
"0": 0,
"1": 1,
"2": 1,
"3": 1,
"4": 1
"2": 1
},
"class_names": [
"NORM", "DIAG"
"NONE", "PAC/PVC"
],
"sampling_rate": 100,
"frame_size": 900,
"frame_size": 512,
"model_file": "model.keras",
"samples_per_patient": [10, 10],
"samples_per_patient": [40, 40],
"val_samples_per_patient": [40, 40],
"val_file": "./results/${task}-class-2-${dataset}-${sampling_rate}fs-${frame_size}sz.pkl",
"test_file": "./results/${task}-class-2-${dataset}-${sampling_rate}fs-${frame_size}sz.pkl",
"val_samples_per_patient": [10, 10],
"val_patients": 0.20,
"val_size": 40000,
"threshold": 0.5,
"test_samples_per_patient": [10, 10],
"test_size": 40000,
"val_size": 24000,
"test_samples_per_patient": [40, 40],
"test_size": 30000,
"batch_size": 256,
"buffer_size": 100000,
"epochs": 125,
"steps_per_epoch": 20,
"epochs": 150,
"steps_per_epoch": 50,
"val_metric": "loss",
"lr_rate": 1e-3,
"lr_cycles": 1,
"class_weights": "balanced",
"label_smoothing": 0.1,
"threshold": 0.60,
"val_acc_threshold": 0.98,
"tflm_var_name": "g_diagnostic_model",
"tflm_file": "diagnostic_model_buffer.h",
"tflm_var_name": "g_beat_model",
"tflm_file": "beat_model_buffer.h",
"backend": "pc",
"quantization": {
"enabled": true,
Expand Down Expand Up @@ -72,17 +69,16 @@
"architecture": {
"name": "efficientnetv2",
"params": {
"input_filters": 32,
"input_filters": 24,
"input_kernel_size": [1, 9],
"input_strides": [1, 2],
"blocks": [
{"filters": 48, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 64, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 4},
{"filters": 96, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 4},
{"filters": 128, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 4}
{"filters": 32, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 40, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 48, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 64, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2}
],
"output_filters": 0,
"output_activation": "sigmoid",
"include_top": true,
"use_logits": true
}
Expand Down
107 changes: 107 additions & 0 deletions configs/beat-3-eff-sm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"name": "beat-3-eff-sm",
"job_dir": "./results/beat-3-eff-sm",
"ds_path": "./datasets",
"datasets": [{
"name": "icentia11k",
"params": {}
}],
"num_classes": 3,
"class_map": {
"0": 0,
"1": 1,
"2": 2
},
"class_names": [
"NONE", "PAC", "PVC"
],
"sampling_rate": 100,
"frame_size": 512,
"model_file": "model.keras",
"samples_per_patient": [10, 40, 40],
"val_samples_per_patient": [10, 40, 40],
"val_file": "./results/${task}-class-3-${dataset}-${sampling_rate}fs-${frame_size}sz.pkl",
"test_file": "./results/${task}-class-3-${dataset}-${sampling_rate}fs-${frame_size}sz.pkl",
"val_patients": 0.20,
"val_size": 30000,
"test_samples_per_patient": [10, 40, 40],
"test_size": 30000,
"batch_size": 256,
"buffer_size": 80000,
"epochs": 150,
"steps_per_epoch": 50,
"val_metric": "loss",
"lr_rate": 1e-3,
"lr_cycles": 1,
"class_weights": "balanced",
"threshold": 0.5,
"val_acc_threshold": 0.98,
"tflm_var_name": "g_beat_model",
"tflm_file": "beat_model_buffer.h",
"backend": "pc",
"display_report": false,
"demo_size": 900,
"quantization": {
"enabled": true,
"qat": false,
"ptq": true,
"input_type": "int8",
"output_type": "int8",
"supported_ops": null
},
"preprocesses": [
{
"name": "filter",
"params": {
"lowcut": 1.0,
"highcut": 30,
"order": 3,
"forward_backward": true,
"axis": 0
}
},
{
"name": "znorm",
"params": {
"eps": 0.01,
"axis": null
}
}
],
"architecture": {
"name": "efficientnetv2",
"params": {
"input_filters": 24,
"input_kernel_size": [1, 9],
"input_strides": [1, 2],
"blocks": [
{"filters": 32, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 40, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 48, "depth": 2, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2},
{"filters": 64, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1, "se_ratio": 2}
],
"output_filters": 0,
"include_top": true,
"use_logits": true
}
},
"architecture-dis": {
"name": "efficientnetv2",
"params": {
"input_filters": 16,
"input_kernel_size": [1, 9],
"input_strides": [1, 2],
"blocks": [
{"filters": 24, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1.5, "se_ratio": 2},
{"filters": 32, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1.5, "se_ratio": 2},
{"filters": 40, "depth": 1, "kernel_size": [1, 9], "strides": [1, 1], "ex_ratio": 1.5, "se_ratio": 2},
{"filters": 48, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1.5, "se_ratio": 2},
{"filters": 56, "depth": 1, "kernel_size": [1, 9], "strides": [1, 1], "ex_ratio": 1.5, "se_ratio": 2},
{"filters": 64, "depth": 1, "kernel_size": [1, 9], "strides": [1, 2], "ex_ratio": 1.5, "se_ratio": 2}
],
"output_filters": 0,
"include_top": true,
"use_logits": true
}
}
}
Loading

0 comments on commit e4bfaab

Please sign in to comment.