Commit bc591fe5 authored by Fernando Perez-Garcia's avatar Fernando Perez-Garcia

Add script for multimodal training with different networks

parent b14174f4
#!/usr/bin/env python3
import sys
print('Importing libraries...')
from pathlib import Path
from vesseg import Model, Job
from vesseg.network.model import DSA, T1, T1_GAD
learning_dir = Path('~/mres_project/learning').expanduser()
nets = 222, 223, 233
combinations = (
(DSA,),
(DSA, T1),
(DSA, T1_GAD),
(DSA, T1, T1_GAD),
)
for net in nets:
for inputs in combinations:
models_dir = learning_dir / 'models' / f'highres3dnet_{net}' / 'multimodal'
network = 'vesseg_networks.highres3dnet_{net}.HighRes3DNet{net}'
string = '-'.join(inputs)
model_name = f'highres3dnet_{net}_{string}'
print(f'Submitting {model_name}...')
model_dir = models_dir / model_name
model = Model(model_dir=model_dir, inputs=inputs)
model.set_images_and_labels_paths()
model.make_csv_files(split_type='subject')
model.config_all()
model.config_input_data(spatial_window_size=96)
model.config_network(network_name=network)
model.write_config_file()
job = Job(model_dir, model.config_path)
job.write()
if len(sys.argv) > 1 and sys.argv[1] == '--submit':
job.submit()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment