'loss_function': 'mae',  # 'mse' or 'mae'
                'lr': 0.001,
                'batch_size': 2560,
                'shuffle': False,
                'normalization':
                'standard_positive',  # 'min_max', 'standard', None
                'epochs': 250
            }

            utrain.train_and_test(params)
            ufig.plot_train_test(ids_attempt[-1], [3, 8, 13, 17],
                                 lim_nr_samples=2000)

        ufig.plot_multi_boxplots(ids=ids_attempt,
                                 x='patient_id',
                                 y='correlation',
                                 hue='brain_state',
                                 save_name=pre + 'corr' + post)
        ufig.plot_multi_boxplots(ids=ids_attempt,
                                 x='patient_id',
                                 y='mae',
                                 hue='brain_state',
                                 save_name=pre + 'mae' + post)
        ufig.plot_multi_boxplots(ids=ids_attempt,
                                 x='patient_id',
                                 y='mse',
                                 hue='brain_state',
                                 save_name=pre + 'mse' + post)

    ufig.mean_weights(ids=ids_all, save_name=pre)
Beispiel #2
0
        for i in range(3):
            ids.append('batch_size_' + str(val) + '_' + pre + '_ID07_32h07m_' + str(i))
            if custom_set:
                custom_test_set = {'time_begin': [32, 7, 20],
                                   'duration': 10,
                                   'batch_size': 50}
                utrain.predict(ids[-1], custom_test_set=custom_test_set)
                utrain.distance(ids[-1])
            print('0')
            ids.append('batch_size_' + str(val) + '_' + pre + '_ID07_35h15m_' + str(i))
            if custom_set:
                custom_test_set = {'time_begin': [35, 15, 20],
                                   'duration': 10,
                                   'batch_size': 50}
                utrain.predict(ids[-1], custom_test_set=custom_test_set)
                utrain.distance(ids[-1])
            print('1')
            ids.append('batch_size_' + str(val) + '_' + pre + '_ID07_38h22m_' + str(i))
            if custom_set:
                custom_test_set = {'time_begin': [38, 22, 20],
                                   'duration': 10,
                                   'batch_size': 50}
                utrain.predict(ids[-1], custom_test_set=custom_test_set)
                utrain.distance(ids[-1])
            print('2')
        print('---------------------------------------------')

    ufig.plot_multi_boxplots(ids=ids, x='batch_size', y='correlation', hue='brain_state',
                             save_name='batch_size_' + pre, ylim=(0, 1))
    ufig.mean_weights(ids=ids, save_name='batch_size_' + pre, hidden=True, diagonal=True)