Commit 0997b994 authored by Andrei-Claudiu Roibu's avatar Andrei-Claudiu Roibu 🖥
Browse files

added AE network + option to run & evaluate in one run

parent 11e183d7
......@@ -40,7 +40,8 @@ import torch.utils.data as data
import numpy as np
from solver import Solver
from BrainMapperUNet import BrainMapperUNet3D, BrainMapperResUNet3D, BrainMapperResUNet3Dshallow, BrainMapperCompResUNet3D
# from BrainMapperUNet import BrainMapperUNet3D, BrainMapperResUNet3D, BrainMapperResUNet3Dshallow, BrainMapperCompResUNet3D
from BrainMapperAE import BrainMapperAE3D
from utils.data_utils import get_datasets, data_test_train_validation_split, update_shuffling_flag, create_folder
import utils.data_evaluation_utils as evaluations
from utils.data_logging_utils import LogWriter
......@@ -149,10 +150,12 @@ def train(data_parameters, training_parameters, network_parameters, misc_paramet
BrainMapperModel = torch.load(
training_parameters['pre_trained_path'])
else:
BrainMapperModel = BrainMapperUNet3D(network_parameters)
# BrainMapperModel = BrainMapperUNet3D(network_parameters)
# BrainMapperModel = BrainMapperResUNet3D(network_parameters)
# BrainMapperModel = BrainMapperResUNet3Dshallow(network_parameters)
# BrainMapperModel = BrainMapperCompResUNet3D(network_parameters)
BrainMapperModel = BrainMapperAE3D(network_parameters)
BrainMapperModel.reset_parameters()
......@@ -420,6 +423,16 @@ if __name__ == '__main__':
delete_files(misc_parameters['experiments_directory'])
delete_files(misc_parameters['logs_directory'])
print('Cleared the current experiments and logs directory successfully!')
elif arguments.mode == 'train-and-evaluate-mapping':
if arguments.settings_path is not None:
settings_evaluation = Settings(arguments.settings_path)
else:
settings_evaluation = Settings('settings_evaluation.ini')
mapping_evaluation_parameters = settings_evaluation['MAPPING']
train(data_parameters, training_parameters,
network_parameters, misc_parameters)
logging.basicConfig(filename='evaluate-mapping-error.log')
evaluate_mapping(mapping_evaluation_parameters)
else:
raise ValueError(
'Invalid mode value! Only supports: train, evaluate-score, evaluate-mapping, clear-experiments and clear-everything')
'Invalid mode value! Only supports: train, evaluate-score, evaluate-mapping, train-and-evaluate-mapping, clear-experiments and clear-everything')
Supports Markdown
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