modifica per usare un file di config

This commit is contained in:
Dmitri 2025-11-20 00:11:05 +01:00
parent 1179f93485
commit 9964843459
Signed by: kanopo
GPG Key ID: 759ADD40E3132AC7
3 changed files with 559 additions and 487 deletions

View File

@ -0,0 +1,74 @@
[
{
"name": "all_dataset_k1",
"k_fold": 1,
"dataset_type": "all",
"oversampling": false,
"undersampling": false,
"epochs": 50,
"path": "~/Documents/womb-wise-data"
},
{
"name": "fetus_dataset_k1",
"k_fold": 1,
"dataset_type": "fetus",
"oversampling": false,
"undersampling": false,
"epochs": 50,
"path": "~/Documents/womb-wise-data"
},
{
"name": "mother_dataset_k1",
"k_fold": 1,
"dataset_type": "mother",
"oversampling": false,
"undersampling": false,
"epochs": 50,
"path": "~/Documents/womb-wise-data"
},
{
"name": "fetus_mother_dataset_k1",
"k_fold": 1,
"dataset_type": "fetus-mother",
"oversampling": false,
"undersampling": false,
"epochs": 50,
"path": "~/Documents/womb-wise-data"
},
{
"name": "mother_fetus_dataset_k1",
"k_fold": 1,
"dataset_type": "mother-fetus",
"oversampling": false,
"undersampling": false,
"epochs": 50,
"path": "~/Documents/womb-wise-data"
},
{
"name": "all_dataset_k5",
"k_fold": 5,
"dataset_type": "all",
"oversampling": false,
"undersampling": false,
"epochs": 50,
"path": "~/Documents/womb-wise-data"
},
{
"name": "fetus_dataset_k5",
"k_fold": 5,
"dataset_type": "fetus",
"oversampling": false,
"undersampling": false,
"epochs": 50,
"path": "~/Documents/womb-wise-data"
},
{
"name": "mother_dataset_k5",
"k_fold": 5,
"dataset_type": "mother",
"oversampling": false,
"undersampling": false,
"epochs": 50,
"path": "~/Documents/womb-wise-data"
}
]

View File

@ -0,0 +1,83 @@
import json
import os
def create_experiments(experiments_path, base_path):
if os.path.exists(experiments_path):
with open(experiments_path, "r") as f:
return json.load(f)
experiments = [
{
"name": "all_dataset_k1",
"k_fold": 1,
"dataset_type": "all",
"oversampling": False,
"undersampling": False,
"epochs": 50,
},
{
"name": "fetus_dataset_k1",
"k_fold": 1,
"dataset_type": "fetus",
"oversampling": False,
"undersampling": False,
"epochs": 50,
},
{
"name": "mother_dataset_k1",
"k_fold": 1,
"dataset_type": "mother",
"oversampling": False,
"undersampling": False,
"epochs": 50,
},
{
"name": "fetus_mother_dataset_k1",
"k_fold": 1,
"dataset_type": "fetus-mother",
"oversampling": False,
"undersampling": False,
"epochs": 50,
},
{
"name": "mother_fetus_dataset_k1",
"k_fold": 1,
"dataset_type": "mother-fetus",
"oversampling": False,
"undersampling": False,
"epochs": 50,
},
{
"name": "all_dataset_k5",
"k_fold": 5,
"dataset_type": "all",
"oversampling": False,
"undersampling": False,
"epochs": 50,
},
{
"name": "fetus_dataset_k5",
"k_fold": 5,
"dataset_type": "fetus",
"oversampling": False,
"undersampling": False,
"epochs": 50,
},
{
"name": "mother_dataset_k5",
"k_fold": 5,
"dataset_type": "mother",
"oversampling": False,
"undersampling": False,
"epochs": 50,
},
]
for experiment in experiments:
experiment["path"] = base_path
with open(experiments_path, "w") as f:
json.dump(experiments, f, indent=4)
return experiments

File diff suppressed because it is too large Load Diff