{
    "name": "seg-4-tcn-sm",
    "project": "hk-segmentation-4",
    "job_dir": "./results/seg-4-tcn-sm",

    "verbose": 2,

    "dataset_weights": [0.20, 0.80],
    "datasets": [{
        "name": "ludb",
        "params": {
            "path": "./datasets/ludb"
        }
    }, {
        "name": "ecg-synthetic",
        "params": {
            "num_pts": 20000,
            "params": {
                "presets": ["SR", "AFIB", "ant_STEMI", "LAHB", "LPHB", "high_take_off", "LBBB", "random_morphology"],
                "preset_weights": [24, 8, 1, 1, 1, 1, 1, 0],
                "duration": 10,
                "sample_rate": 100,
                "heart_rate": [40, 160],
                "impedance": [1, 2],
                "p_multiplier": [0.8, 1.2],
                "t_multiplier": [0.8, 1.2],
                "noise_multiplier": [0.05, 0.1],
                "voltage_factor": [800, 1000]
            }
        }
    }],

    "num_classes": 4,
    "class_map": {
        "0": 0,
        "1": 1,
        "2": 2,
        "3": 3,
        "4": 0,
        "5": 0
    },
    "class_names": [
        "NONE", "P-WAVE", "QRS", "T-WAVE"
    ],

    "sampling_rate": 100,
    "frame_size": 256,

    "samples_per_patient": 5,
    "val_samples_per_patient": 10,
    "test_samples_per_patient": 10,

    "val_size": 20000,
    "test_size": 20000,
    "val_file": "val.tfds",
    "test_file": "val.tfds",

    "class_weights": "balanced",
    "val_patients": 0.10,
    "batch_size": 256,
    "buffer_size": 25000,
    "epochs": 150,
    "steps_per_epoch": 50,
    "val_metric": "loss",
    "lr_rate": 1e-3,
    "lr_cycles": 1,

    "test_metric": "f1",
    "test_metric_threshold": 0.98,
    "tflm_var_name": "ecg_segmentation_flatbuffer",
    "tflm_file": "ecg_segmentation_flatbuffer.h",

    "backend": "pc",
    "demo_size": 900,
    "display_report": false,

    "quantization": {
        "qat": false,
        "mode": "INT8",
        "io_type": "int8",
        "concrete": true,
        "debug": false
    },

    "preprocesses": [
        {
            "name": "layer_norm",
            "params": {
                "epsilon": 0.01,
                "name": "znorm"
            }
        }
    ],

    "augmentations": [{
        "name": "random_noise_distortion",
        "params": {
            "amplitude": [0, 0.5],
            "frequency": [0.5, 1.5],
            "name": "baseline_wander"
        }
    },{
        "name": "random_sine_wave",
        "params": {
            "amplitude": [0, 0.05],
            "frequency": [45, 50],
            "auto_vectorize": false,
            "name": "powerline_noise"
        }
    },{
        "name": "amplitude_warp",
        "params": {
            "amplitude": [0.9, 1.1],
            "frequency": [0.5, 1.5],
            "name": "amplitude_warp"
        }
    }, {
        "name": "random_noise",
        "params": {
            "factor": [0, 0.025],
            "name": "random_noise"
        }
    }, {
        "name": "random_background_noise",
        "params": {
            "amplitude": [0, 0.025],
            "num_noises": 1,
            "name": "nstdb"
        }
    }],

    "model_file": "model.keras",
    "use_logits": false,
    "architecture": {
        "name": "tcn",
        "params": {
            "input_kernel": [1, 7],
            "input_norm": "batch",
            "blocks": [
                {"depth": 1, "branch": 1, "filters": 16, "kernel": [1, 7], "dilation": [1, 1], "dropout": 0.1, "ex_ratio": 1, "se_ratio": 0, "norm": "batch"},
                {"depth": 1, "branch": 1, "filters": 24, "kernel": [1, 7], "dilation": [1, 2], "dropout": 0.1, "ex_ratio": 1, "se_ratio": 2, "norm": "batch"},
                {"depth": 1, "branch": 1, "filters": 32, "kernel": [1, 7], "dilation": [1, 4], "dropout": 0.1, "ex_ratio": 1, "se_ratio": 2, "norm": "batch"},
                {"depth": 1, "branch": 1, "filters": 48, "kernel": [1, 7], "dilation": [1, 8], "dropout": 0.1, "ex_ratio": 1, "se_ratio": 2, "norm": "batch"}
            ],
            "output_kernel": [1, 7],
            "include_top": true,
            "use_logits": true,
            "model_name": "tcn"
        }
    }
}
