Beispiel #1
0
            type_model, 'Classification_Layer', project_name + '.json'))

    with path_hyperparameters_CL.open('r') as file_descriptor:
        hyperparameters_cl = json.load(file_descriptor)

    params = {
        'dim': dim,
        'path_instances': path_instances,
        'batch_size': hyperparameters_cl['batch_size'],
        'n_clases': 2,
        'n_channels': n_channels,
        'normalized': hyperparameters_cl['normalized'],
        'shuffle': hyperparameters_cl['shuffle']
    }

    validation_ids_instances = read_instance_file_txt(path_ids_instances /
                                                      'test.txt')

    validation_generator = DataGenerators_CrossingDetection_OrderPrediction.DataGeneratorCrossingDetectionOrderPrediction(
        validation_ids_instances, **params)

    path_model = Path(
        join(
            config['Performance_CrossingDetection_OrderPrediction']
            ['path_model'], dataset, 'CrossingDetection', data_sampling,
            'Transfer_Learning', 'OrderPrediction', tuner_type, type_model,
            project_name, 'model.h5'))

    if type_model == 'SIAMESE':

        model = load_model(str(path_model))
dataset = config['CrossingDetection_Shuffle']['dataset']
type_model = config['CrossingDetection_Shuffle']['type_model']
project_name = config['CrossingDetection_Shuffle']['project_name']
tuner_type = config['CrossingDetection_Shuffle']['tuner_type']
data_sampling = config['CrossingDetection_Shuffle']['data_sampling']

path_instances = Path(
    join(config['CrossingDetection_Shuffle']['path_instances'], dataset,
         'CrossingDetection',
         str(n_frames) + '_frames', data_sampling))
path_id_instances = Path(
    join(config['CrossingDetection_Shuffle']['path_id_instances'], dataset))

epochs = config['CrossingDetection_Shuffle']['epochs']

train_ids_instances = read_instance_file_txt(path_id_instances / 'train.txt')

validation_ids_instances = read_instance_file_txt(path_id_instances /
                                                  'validation.txt')

if config['CrossingDetection_Shuffle']['Transfer_Learning']:

    tuner_type_pretext_task = config['CrossingDetection_Shuffle'][
        'tuner_type_pretext_task']

    project_name_pretext_task = config['CrossingDetection_Shuffle'][
        'project_name_pretext_task']

    tensorboard_logs = str(
        Path(
            join(config['CrossingDetection_Shuffle']['tensorboard_logs'],