Esempio n. 1
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/sacred/paper/csp/online/remove-cz/',
        'only_return_exp': False,
    }]
    subject_id_params = dictlistprod({
        'subject_id': ['elkh']  #'anla', 'hawe', 'lufi', 'sama',
    })

    break_params = dictlistprod({
        'with_breaks': [True, False],
    })

    preproc_params = dictlistprod({
        'min_freq': [1],
    })

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        subject_id_params,
        break_params,
        preproc_params,
    ])

    return grid_params
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{ 
        'save_folder': './data/models/sacred/paper/bcic-iv-2a-cross/start/',
        'only_return_exp': False,
        'n_chans': 22
        }]
    subject_folder_params = dictlistprod({
        'subject_id': range(1,10),
        'data_folder': ['/home/schirrmr/data/bci-competition-iv/2a/',]
    })
    loss_params = dictlistprod({
        'loss_expression': ['$tied_loss']})
    preproc_params = dictlistprod({
        'filt_order': [3,],#10
        'clean_train': [False],
        'low_cut_hz': [0,4],
        'train_start_ms': [1500]})
    model_params = dictlistprod({
        'network': ['shallow'] #deep
    })
    eval_params = dictlistprod({
        'kappa_mode': ['max']})

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        subject_folder_params,
        preproc_params,
        loss_params,
        model_params,
        eval_params,
        ])
    
    return grid_params
Esempio n. 3
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        "save_folder":
        "/data/schirrmr/schirrmr/reversible/experiments/dropout-weight-decay",
        "only_return_exp": False,
        "debug": False,
    }]
    subject_id_params = dictlistprod({"subject_id": range(4, 5)})
    data_params = dictlistprod({"n_sensors": [22], "final_hz": [256]})
    preproc_params = dictlistprod({"half_before": [True]})
    ival_params = [{"start_ms": 500, "stop_ms": 1500}]
    training_params = dictlistprod({"max_epochs": [600, 1200]})

    implementation_params = dictlistprod({"constant_memory": [False]})

    init_params = dictlistprod({"set_distribution_to_empirical": [True]})

    optim_params = dictlistprod({
        "uni_noise_factor": [
            0,
            1e-2,
            5e-2,
        ],  #
        "gauss_noise_factor": [0.1],  #
        "weight_decay": [
            1e-4,
        ],  #
    })

    network_params = dictlistprod({
        "final_fft": [True, False],
        'drop_p': [
            0,
            0.1,
        ]
    })  #

    save_params = [{"save_model": True}]

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        subject_id_params,
        data_params,
        implementation_params,
        training_params,
        init_params,
        preproc_params,
        ival_params,
        optim_params,
        network_params,
        save_params,
    ])

    return grid_params
Esempio n. 4
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product

    save_params = [
        {
        'save_folder': '/home/schirrmr/data/exps/invertible-eeg/images/',
    },
    ]

    data_params = [{
        'first_n': None,
    }]
    debug_params = [{
        'debug': False,
    }]

    train_params = dictlistprod({
        'n_epochs': [200],
        'batch_size': [32],
    })

    random_params= dictlistprod({
        'np_th_seed': range(0,2),
    })

    optim_params = dictlistprod({
        'lr': [5e-4],
        'weight_decay': [5e-5],
        'cross_ent_weight': [0,],#1,10,100,1000
        'scale_2_cross_ent': [False, True],
        'mask_for_cross_ent': [False],
        'nll_weight': [1],
        'linear_classifier': [False],
        'flow_gmm': [True],
        'flow_coupling': ['affine'],
    })
    model_params = dictlistprod({
        'n_mixes': [32],
    })



    grid_params = product_of_list_of_lists_of_dicts([
        save_params,
        train_params,
        debug_params,
        random_params,
        optim_params,
        model_params,
        data_params,
    ])

    return grid_params
Esempio n. 5
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        "save_folder":
        "/data/schirrmr/schirrmr/reversible/experiments/new-deep-invertible",
        "only_return_exp": False,
        "debug": False,
    }]
    subject_id_params = dictlistprod({"subject_id": range(4, 10)})
    data_params = dictlistprod({"n_sensors": [22], "final_hz": [256]})
    preproc_params = dictlistprod({"half_before": [True]})
    ival_params = [{"start_ms": 500, "stop_ms": 1500}]
    training_params = dictlistprod({"max_epochs": [1000, 4000]})

    model_params = dictlistprod({"model_name": ["deep_invertible"]})

    implementation_params = dictlistprod({"constant_memory": [True]})

    init_params = dictlistprod({
        "data_zero_init": [False],
        "set_distribution_to_empirical": [True]
    })

    network_params = dictlistprod({"final_fft": [False]})  # True

    clf_params = dictlistprod({"clf_loss": [None,
                                            'sliced']})  # "likelihood", None

    dist_params = dictlistprod({
        "ot_on_class_dims": [False],  # , True
        "independent_class_dists": [True],
    })

    save_params = [{"save_model": True}]

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        subject_id_params,
        data_params,
        implementation_params,
        training_params,
        init_params,
        model_params,
        preproc_params,
        dist_params,
        ival_params,
        network_params,
        clf_params,
        save_params,
    ])

    return grid_params
Esempio n. 6
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product

    debug_params = [{
        'debug': False,
    }]

    data_params = dictlistprod({
        'n_subjects': [None],  #'#'
        'n_seconds': [None],  # 4 is one window
        'subject_id': [None],
    })

    train_params = dictlistprod({
        'n_epochs': [200],
    })

    random_params = dictlistprod({
        'np_th_seed': range(0, 3),
    })

    optim_params = dictlistprod({
        'lr': [5e-4],
        'weight_decay': [5e-5],
    })
    model_params = dictlistprod({
        'hidden_channels': [
            512,
        ],  #512
        'n_virtual_chans': [
            0,
        ],  #1,2
        'n_blocks_up': [4, 8],
        'n_blocks_down': [4, 8],
        'n_mixes': [128],
        'splitter_last': ['haar', 'subsample'],
        'init_perm_to_identity': [
            True,
        ],  #False#True
    })

    grid_params = product_of_list_of_lists_of_dicts([
        data_params,
        train_params,
        debug_params,
        random_params,
        optim_params,
        model_params,
    ])

    return grid_params
Esempio n. 7
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/fbcsp/6-class/avg-cov/',
    }]
    filename_params = [
        {
            'filename':
            '/data/schirrmr/schirrmr/offline-6-class-cabin/AnTiCUO1_1-4_250Hz.BBCI.mat',
        },
        {
            'filename':
            '/data/schirrmr/schirrmr/offline-6-class-cabin/FeHeCUO1_1-8_250Hz.BBCI.mat',
        },
    ]
    filterbank_params = [
        {
            'min_freq': 1,
            'max_freq': 38,
            'low_width': 6,
            'high_width': 8,
            'high_overlap': 4,
            'last_low_freq': 10,
            'low_overlap': 3,
            'n_top_bottom_csp_filters': 5,
            'n_selected_features': 20
        },
        {
            'min_freq': 1,
            'max_freq': 118,
            'low_width': 6,
            'high_width': 8,
            'high_overlap': 4,
            'last_low_freq': 10,
            'low_overlap': 3,
            'n_top_bottom_csp_filters': 5,
            'n_selected_features': 20
        },
    ]
    sensor_params = [{
        'sensors': 'all',
    }, {
        'sensors': 'C_sensors'
    }]

    grid_params = product_of_list_of_lists_of_dicts(
        [default_params, filename_params, filterbank_params, sensor_params])

    return grid_params
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/pytorch/online/niri-repl/',
        'only_return_exp': False,
    }]

    stop_params = [{
        'max_epochs': 200,
    }]

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        stop_params,
    ])

    return grid_params
Esempio n. 9
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/sacred/paper/bcic-iv-2b/deepshallow/',
        'only_return_exp': False,
        'n_chans': 3,
        'run_after_early_stop': True,
    }]
    subject_folder_params = dictlistprod({
        'subject_id':
        range(1, 10),
        'data_folder': ['/home/schirrmr/data/bci-competition-iv/2b/'],
        'train_inds': [[1, 2, 3]],
        'test_inds': [[4, 5]],
        'sets_like_fbcsp_paper': [True],
    })
    model_params = dictlistprod({
        'network': ['deep', 'shallow'],  #'deep'#'shallow'
    })
    stop_params = dictlistprod({'stop_chan': ['misclass']})  #'misclass',

    loss_params = dictlistprod({'loss_expression':
                                ['$tied_loss']})  #'misclass',
    preproc_params = dictlistprod({
        'clean_train': [
            False,
        ],  #False
        'filt_order': [
            3,
        ],  #10
        'low_cut_hz': [0, 4]
    })

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        subject_folder_params,
        model_params,
        stop_params,
        preproc_params,
        loss_params,
    ])

    return grid_params
Esempio n. 10
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/sacred/paper/bcic-iv-2a/repl/',
        'only_return_exp': False,
        'n_chans': 22
    }]
    subject_folder_params = dictlistprod({
        'subject_id':
        range(1, 10),
        'data_folder': [
            '/home/schirrmr/data/bci-competition-iv/2a/',
        ]
    })

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        subject_folder_params,
    ])

    return grid_params
Esempio n. 11
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/sacred/paper/bcic-iv-2b/cv-proper-sets/',
        'only_return_exp': False,
        'n_chans': 3,
    }]
    subject_folder_params = dictlistprod({
        'subject_id':
        range(1, 10),
        'data_folder': ['/home/schirrmr/data/bci-competition-iv/2b/'],
    })

    exp_params = dictlistprod({
        'run_after_early_stop': [
            True,
        ],
    })
    stop_params = dictlistprod({'stop_chan': ['misclass']})  #,

    loss_params = dictlistprod({'loss_expression':
                                ['$tied_loss']})  #'misclass',
    preproc_params = dictlistprod({
        'filt_order': [
            3,
        ],  #10
        'low_cut_hz': [4],
        'sets_like_fbcsp_paper': [False, True]
    })

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        exp_params,
        subject_folder_params,
        stop_params,
        preproc_params,
        loss_params,
    ])

    return grid_params
Esempio n. 12
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product

    save_params = [
        {
            'save_folder':
            '/home/schirrmr/data/exps/invertible-eeg/hgd-21-ch-32-hz/',
        },
    ]

    data_params = dictlistprod({
        'subject_id': list(range(1, 15)),
        'dataset_name': ['hgd'],  # 4 is one window
    })

    model_params = dictlistprod({
        'hidden_channels': [
            128,
        ],  #512
        'n_virtual_chans': [
            0,
        ],  #1,2
        'n_blocks_up': [8],
        'n_blocks_down': [8],
        'n_mixes': [128],
        'splitter_last': [
            'haar',
        ],
        'init_perm_to_identity': [
            True,
        ],  #False#True
    })

    grid_params = product_of_list_of_lists_of_dicts([
        save_params,
        data_params,
        model_params,
    ])

    return grid_params
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [
        {
            "save_folder": "/data/schirrmr/schirrmr/reversible/experiments/deepshallow",
            "only_return_exp": False,
            "debug": False,
        }
    ]
    subject_id_params = dictlistprod({"subject_id": range(4, 10)})
    data_params = dictlistprod({"n_sensors": [22], "final_hz": [256]})
    preproc_params = dictlistprod({"half_before": [True]})
    ival_params = [{"start_ms": 500, "stop_ms": 1500}]
    training_params = dictlistprod({"max_epochs": [100]})

    model_params = dictlistprod({"model": ["deep_invertible",],
                                 "final_fft": [True],
                                 "add_bnorm": [False],})  # , True

    optim_params = dictlistprod({"weight_decay": [0.5 * 0.001, 0.5*0.01],
                                 "act_norm": [True, False]})

    save_params = [{"save_model": False}]

    grid_params = product_of_list_of_lists_of_dicts(
        [
            default_params,
            subject_id_params,
            data_params,
            training_params,
            preproc_params,
            ival_params,
            training_params,
            model_params,
            save_params,
            optim_params,
        ]
    )

    return grid_params
Esempio n. 14
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product

    save_params = [
        {
            'save_folder':
            '/home/schirrmr/data/exps/invertible-eeg/tuh-all-chans/',
        },
    ]

    data_params = dictlistprod({
        'n_subjects': [2076],  #'#'
        'n_seconds': [15 * 4],  # 4 is one window
        'dataset_name': ['tuh'],  # 4 is one window
    })

    grid_params = product_of_list_of_lists_of_dicts([
        save_params,
        data_params,
    ])

    return grid_params
Esempio n. 15
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/pytorch/auto-diag/smac-test/',
        'only_return_exp': False,
    }]

    load_params = [{
        'max_recording_mins': 35,
        'n_recordings': 5,
    }]

    clean_defaults = {
        'max_min_threshold': None,
        'shrink_val': None,
        'max_min_expected': None,
        'max_abs_val': None,
        'batch_set_zero_val': None,
        'batch_set_zero_test': None,
        'max_min_remove': None,
    }

    clean_variants = [
        #{},
        #{'batch_set_zero_val': 500, 'batch_set_zero_test': True},
        {
            'max_abs_val': 800
        },
        #{'max_abs_val' : 500},
        #{'shrink_val': 200},
        #{'shrink_val': 500},
        # {'shrink_val': 800},
    ]

    clean_params = product_of_list_of_lists_of_dicts([[clean_defaults],
                                                      clean_variants])

    preproc_params = dictlistprod({
        'sec_to_cut': [60],
        'duration_recording_mins': [3],
        'sampling_freq': [100],
        'low_cut_hz': [
            None,
        ],
        'high_cut_hz': [
            None,
        ],
        'divisor': [10],
    })

    standardizing_defaults = {
        'exp_demean': False,
        'exp_standardize': False,
        'moving_demean': False,
        'moving_standardize': False,
        'channel_demean': False,
        'channel_standardize': False,
    }

    standardizing_variants = [
        {},
    ]

    standardizing_params = product_of_list_of_lists_of_dicts(
        [[standardizing_defaults], standardizing_variants])

    split_params = dictlistprod({
        'n_folds': [5],
        'i_test_fold': [0],
    })

    model_params = [
        {
            'input_time_length': 1200,
            'final_conv_length': 40,
            'model_name': 'shallow',
        },
    ]

    model_constraint_params = dictlistprod({
        'model_constraint': ['defaultnorm', None],
    })

    iterator_params = [{'batch_size': 64}]

    stop_params = [{
        'max_epochs': 3,
    }]

    grid_params = product_of_list_of_lists_of_dicts([
        default_params, load_params, clean_params, preproc_params,
        split_params, model_params, iterator_params, standardizing_params,
        stop_params, model_constraint_params
    ])

    return grid_params
Esempio n. 16
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/pytorch/auto-diag/threepath-10fold/',
        'only_return_exp': False,
    }]

    load_params = [{
        'max_recording_mins': 35,
        'n_recordings': 1500,
    }]

    clean_defaults = {
        'max_min_threshold': None,
        'shrink_val': None,
        'max_min_expected': None,
        'max_abs_val': None,
        'batch_set_zero_val': None,
        'batch_set_zero_test': None,
        'max_min_remove': None,
    }

    clean_variants = [
        {'max_abs_val' : 800},
    ]

    clean_params = product_of_list_of_lists_of_dicts(
        [[clean_defaults], clean_variants])


    preproc_params = dictlistprod({
        'sec_to_cut': [60],
        'duration_recording_mins': [3],
        'sampling_freq': [100],
        'low_cut_hz': [None,],
        'high_cut_hz': [None,],
        'divisor': [10],
    })

    standardizing_defaults = {
        'exp_demean': False,
        'exp_standardize': False,
        'moving_demean': False,
        'moving_standardize': False,
        'channel_demean': False,
        'channel_standardize': False,
    }

    standardizing_variants = [
        {},
    ]

    standardizing_params = product_of_list_of_lists_of_dicts(
        [[standardizing_defaults], standardizing_variants])

    split_params = dictlistprod({
        'n_folds': [10],
        'i_test_fold': [0,1,2,3,4,5,6,7,8,9],
    })


    model_params = dictlistprod({
            'virtual_chan_1x1_conv': [True],
            'mean_across_features': [False],
            'n_classifier_filters': [100,],
            'n_start_filters': [8,10],
            'drop_prob': [0.5],
            'early_bnorm': [False],
            'extra_conv_stride': [2,4,],
            'later_kernel_len': [5,9],
        })

    model_params = product_of_list_of_lists_of_dicts(
        [model_params,
         [
             {
            'n_preds_per_input': 3000,
             'input_time_length': 6000,
         },
         ]
    ]
    )

    final_layer_params = dictlistprod({
        'sigmoid': [False ],
    })

    model_constraint_params = dictlistprod({
        'model_constraint': ['defaultnorm', ],

    })

    iterator_params = [{
        'batch_size':  64
    }]

    stop_params = [{
        'max_epochs': 35,
    }]


    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        load_params,
        clean_params,
        preproc_params,
        split_params,
        model_params,
        final_layer_params,
        iterator_params,
        standardizing_params,
        stop_params,
        model_constraint_params
    ])

    return grid_params
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder': './data/models/pytorch/auto-diag/more-layers/',
        'only_return_exp': False,
    }]

    load_params = [{
        'max_recording_mins': 35,
        'n_recordings': 1500,
    }]

    clean_defaults = {
        'max_min_threshold': None,
        'shrink_val': None,
        'max_min_expected': None,
        'max_abs_val': None,
        'batch_set_zero_val': None,
        'batch_set_zero_test': None,
        'max_min_remove': None,
    }

    clean_variants = [
        {
            'max_abs_val': 800
        },
    ]

    clean_params = product_of_list_of_lists_of_dicts([[clean_defaults],
                                                      clean_variants])

    preproc_params = dictlistprod({
        'sec_to_cut': [60],
        'duration_recording_mins': [3],
        'sampling_freq': [100],
        'low_cut_hz': [
            None,
        ],
        'high_cut_hz': [
            None,
        ],
        'divisor': [10],
    })

    standardizing_defaults = {
        'exp_demean': False,
        'exp_standardize': False,
        'moving_demean': False,
        'moving_standardize': False,
        'channel_demean': False,
        'channel_standardize': False,
    }

    standardizing_variants = [
        {},
    ]

    standardizing_params = product_of_list_of_lists_of_dicts(
        [[standardizing_defaults], standardizing_variants])

    split_params = dictlistprod({
        'n_folds': [10],
        'i_test_fold': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    })

    model_params = [
        {
            'input_time_length': 18000,
            'final_conv_length': 1,
        },
    ]

    model_params = product_of_list_of_lists_of_dicts([
        model_params,
        dictlistprod({
            'pool_stride': [3],
            'n_blocks_to_add': [0, 1, 2]
        }) + dictlistprod({
            'pool_stride': [4],
            'n_blocks_to_add': [0, 1]
        })
    ])

    final_layer_params = dictlistprod({
        'sigmoid': [False],
    })

    model_constraint_params = dictlistprod({
        'model_constraint': [
            'defaultnorm',
        ],
    })

    iterator_params = [{'batch_size': 32}]

    stop_params = [{
        'max_epochs': 35,
    }]

    grid_params = product_of_list_of_lists_of_dicts([
        default_params, load_params, clean_params, preproc_params,
        split_params, model_params, final_layer_params, iterator_params,
        standardizing_params, stop_params, model_constraint_params
    ])

    return grid_params
Esempio n. 18
0
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product

    train_test_filenames = [
        {
            'train_filename': 'BhNoMoSc1S001R01_ds10_1-12.BBCI.mat',
            'test_filename': 'BhNoMoSc1S001R13_ds10_1-2BBCI.mat',
        },
        {
            'train_filename': 'FaMaMoSc1S001R01_ds10_1-14.BBCI.mat',
            'test_filename': 'FaMaMoSc1S001R15_ds10_1-2BBCI.mat',
        },
        {
            'train_filename': 'FrThMoSc1S001R01_ds10_1-11.BBCI.mat',
            'test_filename': 'FrThMoSc1S001R12_ds10_1-2BBCI.mat',
        },
        {
            'train_filename': 'GuJoMoSc01S001R01_ds10_1-11.BBCI.mat',
            'test_filename': 'GuJoMoSc01S001R12_ds10_1-2BBCI.mat'
        },
        {
            'train_filename': 'KaUsMoSc1S001R01_ds10_1-11.BBCI.mat',
            'test_filename': 'KaUsMoSc1S001R12_ds10_1-2BBCI.mat'
        },
        {
            'train_filename': 'LaKaMoSc1S001R01_ds10_1-9.BBCI.mat',
            'test_filename': 'LaKaMoSc1S001R10_ds10_1-2BBCI.mat'
        },
        {
            'train_filename': 'LuFiMoSc3S001R01_ds10_1-11.BBCI.mat',
            'test_filename': 'LuFiMoSc3S001R12_ds10_1-2BBCI.mat'
        },
        {
            'train_filename': 'MaJaMoSc1S001R01_ds10_1-11.BBCI.mat',
            'test_filename': 'MaJaMoSc1S001R12_ds10_1-2BBCI.mat'
        },
        {
            'train_filename': 'MaKiMoSC01S001R01_ds10_1-4.BBCI.mat',
            'test_filename': 'MaKiMoSC01S001R05_ds10_1-2BBCI.mat'
        },
        {
            'train_filename': 'MaVoMoSc1S001R01_ds10_1-11.BBCI.mat',
            'test_filename': 'MaVoMoSc1S001R12_ds10_1-2BBCI.mat'
        },
        # {
        #     'train_filename': 'PiWiMoSc1S001R01_ds10_1-11.BBCI.mat',
        #     'test_filename': 'PiWiMoSc1S001R12_ds10_1-2BBCI.mat'
        # },
        # {
        #     'train_filename': 'RoBeMoSc03S001R01_ds10_1-9.BBCI.mat',
        #     'test_filename': 'RoBeMoSc03S001R10_ds10_1-2BBCI.mat'
        # },
        # {
        #     'train_filename': 'RoScMoSc1S001R01_ds10_1-11.BBCI.mat',
        #     'test_filename': 'RoScMoSc1S001R12_ds10_1-2BBCI.mat'
        # },
        # {
        #     'train_filename': 'StHeMoSc01S001R01_ds10_1-10.BBCI.mat',
        #     'test_filename': 'StHeMoSc01S001R11_ds10_1-2BBCI.mat'
        # },
    ]

    data_split_train_params = dictlistprod({
        'n_folds': [10],
        'i_test_fold': list(range(9, 10)),
        'test_on_eval_set': [False],
    })
    # data_split_test_params = [
    # {
    #     'n_folds': None,
    #     'i_test_fold': None,
    #     'test_on_eval_set': True,
    # }]

    no_early_stop_params = [{
        'valid_set_fraction': None,
        'use_validation_set': False,
        'max_increase_epochs': None,
    }]

    adamw_adam_comparison_params = [{
        'use_norm_constraint': False,
        'optimizer_name': 'adam',
        'schedule_weight_decay': False,
    }, {
        'use_norm_constraint': False,
        'optimizer_name': 'adamw',
        'schedule_weight_decay': True,
    }]

    scheduler_params = dictlistprod({
        'scheduler_name': [
            'cosine',
        ],
        'restarts': [None],
    })

    lr_weight_decay_params = dictlistprod({
        'model_name': ['deep'],
        'init_lr':
        np.array([1 / 8.0, 4.0, 8.0]) * 0.01,
        'weight_decay':
        np.array([
            0, 1 / 64.0, 1 / 32.0, 1 / 16.0, 1 / 8.0, 1 / 4.0, 1 / 2.0, 1.0,
            2.0, 4.0, 8.0
        ]) * 0.001,
    }) + dictlistprod({
        'model_name': ['deep'],
        'init_lr':
        np.array([1 / 8.0, 1 / 4.0, 1 / 2.0, 1.0, 2.0, 4.0, 8.0]) * 0.01,
        'weight_decay':
        np.array([1 / 64.0, 8.0]) * 0.001,  #8.0 possibly removable
    }) + dictlistprod({
        'model_name': ['shallow'],
        'init_lr':
        np.array([
            1 / 128.0,
            1 / 64.0,
            1 / 2.0,
        ]) * 0.01,
        'weight_decay':
        np.array([
            0, 1 / 128.0, 1 / 64.0, 1 / 32.0, 1 / 16.0, 1 / 8.0, 1 / 4.0,
            1 / 2.0, 1.0, 2.0, 4.0
        ]) * 0.001,
    }) + dictlistprod({
        'model_name': ['shallow'],
        'init_lr':
        np.array([
            1 / 128.0,
            1 / 64.0,
            1 / 32.0,
            1 / 16.0,
            1 / 8.0,
            1 / 4.0,
            1 / 2.0,
        ]) * 0.01,
        'weight_decay':
        np.array([1 / 128.0, 1 / 64.0, 2.0, 4.0]) * 0.001,
    }) + dictlistprod({
        'model_name': ['resnet-xavier-uniform'],
        'init_lr':
        np.array([1 / 128.0, 1 / 64.0, 1 / 2.0, 1]) * 0.01,
        'weight_decay':
        np.array([
            0, 1 / 32.0, 1 / 16.0, 1 / 8.0, 1 / 4.0, 1 / 2.0, 1.0, 2.0, 4.0,
            8.0, 16
        ]) * 0.001,
    }) + dictlistprod({
        'model_name': ['resnet-xavier-uniform'],
        'init_lr':
        np.array([
            1 / 128.0, 1 / 64.0, 1 / 32.0, 1 / 16.0, 1 / 8.0, 1 / 4.0, 1 / 2.0,
            1
        ]) * 0.01,
        'weight_decay':
        np.array([16.0]) * 0.001,
    })

    # final_settings_params = [{
    #     'max_epochs': 320,
    #     'save_folder': '/home/schirrmr/data/models/adameegeval/final-no-restart/',
    #     'use_norm_constraint': False,
    #     'restarts': None,
    # }]

    # final_settings_variants = [
    #     {
    #         'model_name': 'deep',
    #         'optimizer_name': 'adam',
    #         'scheduler_name': None,
    #         'schedule_weight_decay': False,
    #         'init_lr': 0.5 * 0.01,
    #         'weight_decay': (1/32.0) * 0.001,
    #     },
    #     {
    #         'model_name': 'deep',
    #         'optimizer_name': 'adam',
    #         'scheduler_name': 'cosine',
    #         'schedule_weight_decay': False,
    #         'init_lr': 2.0 * 0.01,
    #         'weight_decay': (1/8.0) * 0.001,
    #     },
    #     {
    #         'model_name': 'deep',
    #         'optimizer_name': 'adamw',
    #         'scheduler_name': None,
    #         'schedule_weight_decay': True,
    #         'init_lr': 2.0 * 0.01,
    #         'weight_decay': 0 * 0.001,
    #     },
    #     {
    #         'model_name': 'deep',
    #         'optimizer_name': 'adamw',
    #         'scheduler_name': 'cosine',
    #         'schedule_weight_decay': True,
    #         'init_lr': 1.0 * 0.01,
    #         'weight_decay': 0.5 * 0.001,
    #     },
    #     {
    #         'model_name': 'shallow',
    #         'optimizer_name': 'adam',
    #         'scheduler_name': None,
    #         'schedule_weight_decay': False,
    #         'init_lr': (1/32.0) * 0.01,
    #         'weight_decay': (1/32.0) * 0.001,
    #     },
    #     {
    #         'model_name': 'shallow',
    #         'optimizer_name': 'adam',
    #         'scheduler_name': 'cosine',
    #         'schedule_weight_decay': False,
    #         'init_lr': (1/8.0) * 0.01,
    #         'weight_decay': 1.0 * 0.001,
    #     },
    #     {
    #         'model_name': 'shallow',
    #         'optimizer_name': 'adamw',
    #         'scheduler_name': None,
    #         'schedule_weight_decay': True,
    #         'init_lr': (1/32.0) * 0.01,
    #         'weight_decay': (1/8.0) * 0.001,
    #     },
    #     {
    #         'model_name': 'shallow',
    #         'optimizer_name': 'adamw',
    #         'scheduler_name': 'cosine',
    #         'schedule_weight_decay': True,
    #         'init_lr': (1/16.0) * 0.01,
    #         'weight_decay': 0 * 0.001,
    #     },
    #     {
    #         'model_name': 'resnet-xavier-uniform',
    #         'optimizer_name': 'adam',
    #         'scheduler_name': None,
    #         'schedule_weight_decay': False,
    #         'init_lr': (1/32.0) * 0.01,
    #         'weight_decay': 0 * 0.001,
    #     },
    #     {
    #         'model_name': 'resnet-xavier-uniform',
    #         'optimizer_name': 'adam',
    #         'scheduler_name': 'cosine',
    #         'schedule_weight_decay': False,
    #         'init_lr': (1/8.0) * 0.01,
    #         'weight_decay': 2.0 * 0.001,
    #     },
    #     {
    #         'model_name': 'resnet-xavier-uniform',
    #         'optimizer_name': 'adamw',
    #         'scheduler_name': None,
    #         'schedule_weight_decay': True,
    #         'init_lr': (1/16.0) * 0.01,
    #         'weight_decay': (1/32.0) * 0.001,
    #     },
    #     {
    #         'model_name': 'resnet-xavier-uniform',
    #         'optimizer_name': 'adamw',
    #         'scheduler_name': 'cosine',
    #         'schedule_weight_decay': True,
    #         'init_lr': (1/32.0) * 0.01,
    #         'weight_decay': 2.0 * 0.001,
    #     },
    # ]

    seed_params = dictlistprod({
        'np_th_seed': [0]  #0,1,2,3,4
    })

    preproc_params = dictlistprod({
        'low_cut_hz': [4]  #0
    })

    stop_params = [
        # #    {'max_epochs': None},
        {
            'max_epochs':
            20,
            'save_folder':
            '/home/schirrmr/data/models/adameegeval/4sec-cv-lr-wd-20-epoch-2/',
        },
        {
            'max_epochs':
            40,
            'save_folder':
            '/home/schirrmr/data/models/adameegeval/4sec-cv-lr-wd-40-epoch-2/',
        },
        {
            'max_epochs':
            80,
            'save_folder':
            '/home/schirrmr/data/models/adameegeval/4sec-cv-lr-wd-80-epoch/',
        },
        {
            'max_epochs':
            160,
            'save_folder':
            '/home/schirrmr/data/models/adameegeval/4sec-cv-lr-wd-160-epoch/',
        },
        {
            'max_epochs':
            320,
            'save_folder':
            '/home/schirrmr/data/models/adameegeval/4sec-cv-lr-wd-320-epoch/',
        },
    ]

    debug_params = [{
        'debug': False,
    }]

    grid_params = product_of_list_of_lists_of_dicts([
        train_test_filenames,
        data_split_train_params,
        preproc_params,
        no_early_stop_params,
        adamw_adam_comparison_params,
        scheduler_params,
        lr_weight_decay_params,
        stop_params,
        seed_params,
        debug_params,
    ])

    return grid_params
def get_grid_param_list():
    dictlistprod = cartesian_dict_of_lists_product
    default_params = [{
        'save_folder':
        '/data/schirrmr/schirrmr/models/auto-diag/final-eval-from-smalldata-config/',
        'only_return_exp': False,
    }]

    seed_params = dictlistprod({
        'np_th_seed': list(range(5, 10))  #[0,1,2,3,4]
    })

    save_params = [{
        'save_predictions': False,
        'save_crop_predictions': False,
    }]

    load_params = [{
        'max_recording_mins': 35,
        'n_recordings': None,
    }]

    clean_params = [{
        'max_abs_val': 800,
    }]

    sensor_params = [
        {
            'n_chans': 21,
            'sensor_types': ['EEG'],
        },
    ]

    preproc_params = dictlistprod({
        'sec_to_cut_at_start': [60],
        'sec_to_cut_at_end': [0],
        'duration_recording_mins': [20],
        'test_recording_mins': [None],
        'sampling_freq': [100],
        'divisor': [
            None,
        ],  # 10 before
        'clip_before_resample': [False],  #False,
    })

    # this differentiates train/test also.
    split_params = dictlistprod({
        'test_on_eval': [True],
        'n_folds': [5],
        'i_test_fold': [4],
        'shuffle': [False],
    })

    model_params = [
        # {
        #     'input_time_length': 6000,
        #     'final_conv_length': 35,
        #     'model_name': 'shallow',
        #     'n_start_chans': 40,
        #     'n_chan_factor': None,
        #     'model_constraint': 'defaultnorm',
        #     'stride_before_pool': None,
        #     'scheduler': None,
        #     'optimizer': 'adam',
        #     'learning_rate': 1e-3,
        #     'weight_decay': 0,
        #     'merge_train_valid': False,
        # },
        # {
        #     'input_time_length': 6000,
        #     'final_conv_length': 1,
        #     'model_name': 'deep',
        #     'n_start_chans': 25,
        #     'n_chan_factor': 2,
        #     'model_constraint': 'defaultnorm',
        #     'stride_before_pool': True,
        #     'scheduler': None,
        #     'optimizer': 'adam',
        #     'learning_rate': 1e-3,
        #     'weight_decay': 0,
        #     'merge_train_valid': False,
        # },
        # {
        #     'input_time_length': 6000,
        #     'final_conv_length': 35,
        #     'model_name': 'shallow',
        #     'n_start_chans': 40,
        #     'n_chan_factor': None,
        #     'model_constraint': None,
        #     'stride_before_pool': None,
        #     'scheduler': 'cosine',
        #     'optimizer': 'adamw',
        #     'learning_rate': 0.0625 * 0.01,
        #     'weight_decay': 0,
        #     'merge_train_valid': True,
        # },
        {
            'input_time_length': 6000,
            'final_conv_length': 1,
            'model_name': 'deep',
            'n_start_chans': 25,
            'n_chan_factor': 2,
            'model_constraint': None,
            'stride_before_pool': True,
            'scheduler': 'cosine',
            'optimizer': 'adamw',
            'learning_rate': 1 * 0.01,
            'weight_decay': 0.5 * 0.001,
            'merge_train_valid': True,
        },
    ]

    iterator_params = [{'batch_size': 64}]

    stop_params = [{
        'max_epochs': 35,
    }]

    grid_params = product_of_list_of_lists_of_dicts([
        default_params,
        seed_params,
        save_params,
        load_params,
        clean_params,
        preproc_params,
        sensor_params,
        split_params,
        model_params,
        iterator_params,
        stop_params,
    ])

    return grid_params