Beispiel #1
0
def test_w2v_custom_emb(option, function, set_params):
    set_params.update({
        'embedding_types': [dn.EmbeddingType.WORD2VEC_CUSTOM],
        'embedding_custom_files': [
            'SMHD-Skipgram-AllUsers-300.bin', 'SMHD-CBOW-AllUsers-300.bin',
            'SMHD-Skipgram-A-D-ADUsers-300.bin',
            'SMHD-CBOW-A-D-ADUsers-300.bin'
        ],
        'use_embeddings': [dn.UseEmbedding.STATIC, dn.UseEmbedding.NON_STATIC]
    })

    if option == '1':
        print('Initializer experiment '+option+' (model SMHD_cnn_gl_1040_A_D)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040 diffs')
        exp = ExperimentProcesses('t' + option + '_cnn_L1')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=1040,
            subdirectory="only_disorders/A_D")
        generate_model(exp, 't' + option + '_SMHD_cnn_gl_1040_A_D', '_glorot',
                       set_params, function)

    elif option == '2':
        print('Initializer experiment '+option+' (model SMHD_cnn_gl_880_A_AD)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 diffs')
        exp = ExperimentProcesses('t' + option + '_cnn_L1')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="only_disorders/A_AD")
        generate_model(exp, 't' + option + '_SMHD_cnn_gl_880_A_AD', '_glorot',
                       set_params, function)

    elif option == '3':
        print('Initializer experiment '+option+' (model SMHD_ml_gl_880_D_AD)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 diffs')
        exp = ExperimentProcesses('t' + option + '_cnn_L1')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="only_disorders/D_AD")
        generate_model(exp, 't' + option + '_SMHD_ml_gl_880_D_AD', '_glorot',
                       set_params, function)
def test_w2v_custom_emb(option, function):
		set_params = dict({'filters_by_layer': [100, 250],
											 'kernels_size': [3, 4, 5],
											 'epochs': [10],
											 'batch_sizes': [20],
											 'dropouts': [0.2, 0.5],
											 'embedding_types': [dn.EmbeddingType.WORD2VEC_CUSTOM],
											 'embedding_custom_files': ['SMHD-Skipgram-AllUsers-300.bin', 'SMHD-CBOW-AllUsers-300.bin',
																									'SMHD-Skipgram-A-D-ADUsers-300.bin', 'SMHD-CBOW-A-D-ADUsers-300.bin'],
											 'use_embeddings': [dn.UseEmbedding.STATIC, dn.UseEmbedding.NON_STATIC]})
		
		if option == '1':
				print('Initializer experiment ' + option + ' (model SMHD_cnn_gl_880)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 multi-label')
				exp = ExperimentProcesses('t' + option + '_cnn_L1')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="anxiety,depression")
				generate_model(exp, 't' + option + '_wc_SMHD_cnn_gl_880', '_glorot', set_params, function)
		
		elif option == '2':
				print('Initializer experiment ' + option + ' (model SMHD_cnn_gl_1040)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040 multi-label')
				exp = ExperimentProcesses('t' + option + '_cnn_L1')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="anxiety")
				generate_model(exp, 't' + option + '_wc_SMHD_cnn_gl_1040', '_glorot', set_params, function)
		
		elif option == '3':
				print('Initializer experiment ' + option + ' (model SMHD_cnn_gl_2160)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2160 multi-label')
				exp = ExperimentProcesses('t' + option + '_cnn_L1')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2160, subdirectory="depression")
				generate_model(exp, 't' + option + '_wc_SMHD_cnn_gl_2160', '_glorot', set_params, function)
		
		elif option == '4':
				print('Initializer experiment ' + option + ' (model SMHD_cnn_gl_2640)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label')
				exp = ExperimentProcesses('t' + option + '_cnn_L1')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2640, subdirectory="anx_dep_multilabel")
				generate_model(exp, 't' + option + '_wc_SMHD_cnn_gl_2460', '_glorot', set_params, function)
def generate_model(set_params, train_mode=True):
    from utils.experiment_processes import ExperimentProcesses
    import utils.definition_network as dn

    exp = ExperimentProcesses(set_params['function'])
    exp.pp_data.vocabulary_size = 5000

    exp.pp_data.embedding_size = 300
    exp.pp_data.max_posts = 1750
    exp.pp_data.max_terms_by_post = 300
    exp.pp_data.binary_classifier = True
    exp.pp_data.format_input_data = dn.InputData.POSTS_ONLY_TEXT
    exp.pp_data.remove_stopwords = False
    exp.pp_data.delete_low_tfid = False
    exp.pp_data.min_df = 0
    exp.pp_data.min_tf = 0
    exp.pp_data.random_posts = False
    exp.pp_data.random_users = True
    exp.pp_data.tokenizing_type = 'WE'
    exp.pp_data.type_prediction_label = dn.TypePredictionLabel.MULTI_LABEL_CATEGORICAL

    exp.use_custom_metrics = False
    exp.use_valid_set_for_train = True
    exp.valid_split_from_train_set = 0.0
    exp.imbalanced_classes = False

    exp.pp_data.embedding_type = set_params['embedding_type']
    exp.pp_data.word_embedding_custom_file = set_params['custom_file']
    exp.pp_data.use_embedding = set_params['use_embedding']

    if train_mode:
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL
    else:
        exp.pp_data.load_dataset_type = dn.LoadDataset.TEST_DATA_MODEL

    exp.pp_data.set_dataset_source(
        dataset_name='SMHD',
        label_set=['control', 'anxiety', 'depression'],
        total_registers=set_params['total_registers'],
        subdirectory=set_params['subdirectory'])

    return exp
def test_diff_we_function(function, option):
    if function == 'gloveTwitter':
        set_params = dict({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [40],
            'epochs': [32],
            'embedding_types': [dn.EmbeddingType.GLOVE_TWITTER],
            'embedding_custom_files': ['']
        })
        if option == '1':
            set_params.update({'use_embeddings': [dn.UseEmbedding.STATIC]})
        else:
            set_params.update({'use_embeddings': [dn.UseEmbedding.NON_STATIC]})

        model_name = 't' + option + '_gt_SMHD_ml_gl_2640_var_hl'

    elif function == 'googleNews':
        set_params = dict({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [40],
            'epochs': [32],
            'embedding_types': [dn.EmbeddingType.WORD2VEC],
            'embedding_custom_files': ['']
        })
        if option == '1':
            set_params.update({'use_embeddings': [dn.UseEmbedding.STATIC]})
        else:
            set_params.update({'use_embeddings': [dn.UseEmbedding.NON_STATIC]})

        model_name = 't' + option + '_gn_SMHD_ml_gl_2640_var_hl'

    elif function == 'gloveCustom':
        set_params = dict({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [40],
            'epochs': [32],
            'embedding_types': [dn.EmbeddingType.GLOVE_CUSTOM],
            'embedding_custom_files':
            ['SMHD-glove-AllUsers-300.pkl', 'SMHD-glove-A-D-ADUsers-300.pkl']
        })
        if option == '1':
            set_params.update({'use_embeddings': [dn.UseEmbedding.STATIC]})
        else:
            set_params.update({'use_embeddings': [dn.UseEmbedding.NON_STATIC]})

        model_name = 't' + option + '_gc_SMHD_ml_gl_2640_var_hl'

    else:  # 'w2vCustom'
        set_params = dict({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [40],
            'epochs': [32],
            'embedding_types': [dn.EmbeddingType.WORD2VEC_CUSTOM],
            'embedding_custom_files': [
                'SMHD-Skipgram-AllUsers-300.bin', 'SMHD-CBOW-AllUsers-300.bin',
                'SMHD-Skipgram-A-D-ADUsers-300.bin',
                'SMHD-CBOW-A-D-ADUsers-300.bin'
            ]
        })
        if option == '1':
            set_params.update({'use_embeddings': [dn.UseEmbedding.STATIC]})
        else:
            set_params.update({'use_embeddings': [dn.UseEmbedding.NON_STATIC]})

        model_name = 't' + option + '_wc_SMHD_ml_gl_2640_var_hl'


    print('Initializer experiment multclass_lstm_model '+function+', option '+option+'\n' + \
       'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
       'Neurons by layer variation')
    exp = ExperimentProcesses('lstm_exp9_var_L3')
    exp.pp_data.set_dataset_source(
        dataset_name='SMHD',
        label_set=['control', 'anxiety', 'depression'],
        total_registers=2640,
        subdirectory="anx_dep_multilabel")
    generate_model(exp, model_name, '_glorot', set_params, function)
Beispiel #5
0
def main():
    for arg in sys.argv[1]:
        if arg == '1':
            print('Initializer experiment 1 - model SMHD_anx_1')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(dataset_name='SMHD',
                                           label_set=['control', 'anxiety'],
                                           total_registers=1040)
            generate_model_1(exp, 'SMHD_anx_1')
        elif arg == '2':
            print('Initializer experiment 1 - model SMHD_dep_1')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(dataset_name='SMHD',
                                           label_set=['control', 'depression'],
                                           total_registers=2120)
            generate_model_1(exp, 'SMHD_dep_1')

        elif arg == '3':
            print('Initializer experiment 1 - model SMHD_anx_dep_1')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety,depression'],
                total_registers=880)
            generate_model_1(exp, 'SMHD_anx_dep_1')

        elif arg == '4':
            print('Initializer experiment 1 - model SMHD_anx_2')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(dataset_name='SMHD',
                                           label_set=['control', 'anxiety'],
                                           total_registers=1040)
            generate_model_2(exp, 'SMHD_anx_2')

        elif arg == '5':
            print('Initializer experiment 1 - model SMHD_dep_2')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(dataset_name='SMHD',
                                           label_set=['control', 'depression'],
                                           total_registers=2120)
            generate_model_2(exp, 'SMHD_dep_2')

        elif arg == '6':
            print('Initializer experiment 1 - model SMHD_anx_dep_2')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety,depression'],
                total_registers=880)
            generate_model_2(exp, 'SMHD_anx_dep_2')

        elif arg == '7':
            print('Initializer experiment 1 - model SMHD_anx_3')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(dataset_name='SMHD',
                                           label_set=['control', 'anxiety'],
                                           total_registers=1040)
            generate_model_3(exp, 'SMHD_anx_3')

        elif arg == '8':
            print('Initializer experiment 1 - model SMHD_dep_3')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(dataset_name='SMHD',
                                           label_set=['control', 'depression'],
                                           total_registers=2120)
            generate_model_4(exp, 'SMHD_dep_3')

        else:  #if arg == '9':
            print('Initializer experiment 1 - model SMHD_anx_dep_3')
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety,depression'],
                total_registers=880)
            generate_model_5(exp, 'SMHD_anx_dep_3')
Beispiel #6
0
def test_none_emb(option, function, dataset):
    name_model = 't' + option + '_' + function
    set_params = dict({
        'embedding_types': [dn.EmbeddingType.NONE],
        'embedding_custom_files': [''],
        'use_embeddings': [dn.UseEmbedding.RAND]
    })

    if dataset == 'anx':
        if option == '1':
            set_params.update({
                'filters_by_layer': [128],
                'kernels_size': [4],
                'dropouts': [0.2],
                'neuronios_by_lstm_layer': [64],
                'dropouts_lstm': [0.2],
                'epochs': [50],
                'batch_sizes': [20]
            })
        else:
            set_params.update({
                'filters_by_layer': [128],
                'kernels_size': [5],
                'dropouts': [0.2],
                'neuronios_by_lstm_layer': [64],
                'dropouts_lstm': [0.2],
                'epochs': [50],
                'batch_sizes': [20]
            })

        print('Initializer experiment ' + option + ' (model SMHD_cnn_lstm_gl_1040)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040 multi-label')
        exp = ExperimentProcesses(name_model + '_cnn_L1_lstm_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=1040,
            subdirectory="anxiety")
        generate_model(exp, name_model + '_SMHD_cnn_lstm_gl_1040', '_glorot',
                       set_params, function)

    elif dataset == 'dep':
        if option == '1':
            set_params.update({
                'filters_by_layer': [128],
                'kernels_size': [4],
                'dropouts': [0.5],
                'neuronios_by_lstm_layer': [128],
                'dropouts_lstm': [0.2],
                'epochs': [50],
                'batch_sizes': [20]
            })
        else:
            set_params.update({
                'filters_by_layer': [128],
                'kernels_size': [5],
                'dropouts': [0.5],
                'neuronios_by_lstm_layer': [128],
                'dropouts_lstm': [0.2],
                'epochs': [50],
                'batch_sizes': [20]
            })

        print('Initializer experiment ' + option + ' (model SMHD_cnn_lstm_gl_2160)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2160 multi-label')
        exp = ExperimentProcesses(name_model + '_cnn_L1_lstm_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2160,
            subdirectory="depression")
        generate_model(exp, name_model + '_SMHD_cnn_lstm_gl_2160', '_glorot',
                       set_params, function)

    elif dataset == 'anx_dep':
        if option == '1':
            set_params.update({
                'filters_by_layer': [64],
                'kernels_size': [5],
                'dropouts': [0.5],
                'neuronios_by_lstm_layer': [256],
                'dropouts_lstm': [0.2],
                'epochs': [50],
                'batch_sizes': [20]
            })
        else:
            set_params.update({
                'filters_by_layer': [64],
                'kernels_size': [4],
                'dropouts': [0.5],
                'neuronios_by_lstm_layer': [256],
                'dropouts_lstm': [0.2],
                'epochs': [50],
                'batch_sizes': [20]
            })
        print('Initializer experiment ' + option + ' (model SMHD_cnn_lstm_gl_880)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 multi-label')
        exp = ExperimentProcesses(name_model + '_cnn_L1_lstm_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")
        generate_model(exp, name_model + '_SMHD_cnn_lstm_gl_880', '_glorot',
                       set_params, function)

    else:  # multi
        if option == '1':
            set_params.update({
                'filters_by_layer': [64],
                'kernels_size': [4],
                'dropouts': [0.5],
                'neuronios_by_lstm_layer': [64],
                'dropouts_lstm': [0.2],
                'epochs': [50],
                'batch_sizes': [20]
            })
        else:
            set_params.update({
                'filters_by_layer': [128],
                'kernels_size': [5],
                'dropouts': [0.5],
                'neuronios_by_lstm_layer': [256],
                'dropouts_lstm': [0.5],
                'epochs': [50],
                'batch_sizes': [20]
            })
        print('Initializer experiment ' + option + ' (model SMHD_cnn_lstm_gl_2640)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label')
        exp = ExperimentProcesses(name_model + '_cnn_L1_lstm_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, name_model + '_SMHD_cnn_lstm_gl_2640', '_glorot',
                       set_params, function)
def main(arg):
		set_params = dict()
		if arg == '1':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [32],
													 'batch_sizes': [40],
													 'dropouts': [0.1, 0.2]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)
		
		elif arg == '2':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [32],
													 'batch_sizes': [20],
													 'dropouts': [0.1, 0.2]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '3':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [96],
													 'batch_sizes': [20],
													 'dropouts': [0.1]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '4':
				set_params.update({'neuronios_by_layer': [32],
													 'epochs': [64],
													 'batch_sizes': [20],
													 'dropouts': [0.1, 0.2]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '5':
				set_params.update({'neuronios_by_layer': [100],
													 'epochs': [64],
													 'batch_sizes': [20],
													 'dropouts': [0.2]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '6':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [96],
													 'batch_sizes': [20],
													 'dropouts': [0.1]})
				print('Initializer experiment '+arg+' (model SMHD_ml_gl_1040_A_D_glove_a-d-aduser)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				load_submodel_anx(exp, 't'+arg+'_SMHD_ml_gl_1040_A_D_glove_a-d-aduser', '_glorot', set_params)

		elif arg == '7':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [96],
													 'batch_sizes': [20],
													 'dropouts': [0.1]})
				print('Initializer experiment '+arg+' (model SMHD_ml_gl_1040_A_D_cbow_a-d-aduser)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				load_submodel_dep(exp, 't'+arg+'_SMHD_ml_gl_1040_A_D_cbow_a-d-aduser', '_glorot', set_params)

		elif arg == '8':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [32],
													 'batch_sizes': [40],
													 'dropouts': [0.1, 0.2]})
				print('Initializer experiment '+arg+' (model SMHD_ml_le_880_A_AD)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_880 only_disorders/A_AD')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="only_disorders/A_AD")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_880_A_AD', set_params)

		elif arg == '9':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [96],
													 'batch_sizes': [20],
													 'dropouts': [0.1]})
				print('Initializer experiment '+arg+' (model SMHD_ml_gl_880_A_AD_glove_a-d-aduser)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 only_disorders/A_AD')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="only_disorders/A_AD")
				load_submodel_anx(exp, 't'+arg+'_SMHD_ml_gl_880_A_AD_glove_a-d-aduser', '_glorot', set_params)

		elif arg == '10':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [96],
													 'batch_sizes': [20],
													 'dropouts': [0.1]})
				print('Initializer experiment '+arg+' (model SMHD_ml_gl_880_A_AD_cbow_alluser)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 only_disorders/A_AD')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="only_disorders/A_AD")
				load_submodel_anx_dep(exp, 't'+arg+'_SMHD_ml_gl_880_A_AD_cbow_alluser', '_glorot', set_params)

		elif arg == '11':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [32],
													 'batch_sizes': [40],
													 'dropouts': [0.1, 0.2]})
				print('Initializer experiment '+arg+' (model SMHD_ml_le_880_D_AD)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_880 only_disorders/D_AD')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="only_disorders/D_AD")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_880_D_AD', set_params)

		elif arg == '12':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [96],
													 'batch_sizes': [20],
													 'dropouts': [0.1]})
				print('Initializer experiment '+arg+' (model SMHD_ml_gl_880_D_AD_cbow_a-d-aduser)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 only_disorders/D_AD')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="only_disorders/D_AD")
				load_submodel_dep(exp, 't'+arg+'_SMHD_ml_gl_880_D_AD_cbow_a-d-aduser', '_glorot', set_params)

		elif arg == '13':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [96],
													 'batch_sizes': [20],
													 'dropouts': [0.1]})
				print('Initializer experiment '+arg+' (model SMHD_ml_gl_880_D_AD_cbow_alluser)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 only_disorders/D_AD')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="only_disorders/D_AD")
				load_submodel_anx_dep(exp, 't'+arg+'_SMHD_ml_gl_880_D_AD_cbow_alluser', '_glorot', set_params)
				
		elif arg == '14':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [32],
													 'batch_sizes': [10],
													 'dropouts': [0.1]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '15':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [32],
													 'batch_sizes': [10],
													 'dropouts': [0.15]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '16':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [32],
													 'batch_sizes': [10],
													 'dropouts': [0.2]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '17':
				set_params.update({'neuronios_by_layer': [32],
													 'epochs': [64],
													 'batch_sizes': [10],
													 'dropouts': [0.1]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '18':
				set_params.update({'neuronios_by_layer': [32],
													 'epochs': [64],
													 'batch_sizes': [10],
													 'dropouts': [0.15]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '19':
				set_params.update({'neuronios_by_layer': [32],
													 'epochs': [64],
													 'batch_sizes': [10],
													 'dropouts': [0.2]})

				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				generate_model_ml_le(exp, 't'+arg+'_SMHD_ml_le_1040_A_D', set_params)

		elif arg == '20':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [64],
													 'batch_sizes': [10],
													 'dropouts': [0.1]})
				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				load_submodel_anx_dep(exp, 't'+arg+'_SMHD_ml_gl_1040_A_D_cbow_alluser', '_glorot', set_params)

		elif arg == '21':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [64],
													 'batch_sizes': [10],
													 'dropouts': [0.15]})
				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				load_submodel_anx_dep(exp, 't'+arg+'_SMHD_ml_gl_1040_A_D_cbow_alluser', '_glorot', set_params)

		elif arg == '22':
				set_params.update({'neuronios_by_layer': [16],
													 'epochs': [64],
													 'batch_sizes': [10],
													 'dropouts': [0.2]})
				print('Initializer experiment '+arg+' (model SMHD_ml_le_1040_A_D)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 only_disorders/A_D')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="only_disorders/A_D")
				load_submodel_anx_dep(exp, 't'+arg+'_SMHD_ml_gl_1040_A_D_cbow_alluser', '_glorot', set_params)
Beispiel #8
0
def main(arg):
    if arg == '1':
        print('Initializer experiment 1 (model SMHD_ml_gl_1040_gloveadad)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=1040,
            subdirectory="anxiety")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [32],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_anx(exp, 'SMHD_ml_gl_1040_gloveadad', '_glorot',
                          set_params)

    elif arg == '2':
        print('Initializer experiment 2 (model SMHD_ml_gl_1040_glove-a-d-ad)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=1040,
            subdirectory="anxiety")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [96],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_anx(exp, 'SMHD_ml_gl_1040_gloveadad', '_glorot',
                          set_params)

    elif arg == '3':
        print('Initializer experiment 3 (model SMHD_ml_gl_1040_glove-a-d-ad)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=1040,
            subdirectory="anxiety")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [96],
            'batch_sizes': [20],
            'dropouts': [0.2]
        })
        load_submodel_anx(exp, 'SMHD_ml_gl_1040_gloveadad', '_glorot',
                          set_params)

    elif arg == '4':
        print('Initializer experiment 4 (model SMHD_ml_gl_2160_cbow_adad)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2160')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2160,
            subdirectory="depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [32],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_dep(exp, 'SMHD_ml_gl_2160_cbow_adad', '_glorot',
                          set_params)

    elif arg == '5':
        print('Initializer experiment 5 (model SMHD_ml_gl_2160_cbow_adad)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2160')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2160,
            subdirectory="depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [96],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_dep(exp, 'SMHD_ml_gl_2160_cbow_adad', '_glorot',
                          set_params)

    elif arg == '6':
        print('Initializer experiment 6 (model SMHD_ml_gl_2160_cbow_adad)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2160')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2160,
            subdirectory="depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [96],
            'batch_sizes': [20],
            'dropouts': [0.2]
        })
        load_submodel_dep(exp, 'SMHD_ml_gl_2160_cbow_adad', '_glorot',
                          set_params)
Beispiel #9
0
"""
    Test Model using RSDD Dataset
"""
import utils.definition_network as dn
from utils.experiment_processes import ExperimentProcesses
import datetime
# LAYERS
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Embedding, TimeDistributed, Input
from keras.layers import LSTM
from network_model.model_class import ModelClass

if __name__ == '__main__':
		exp = ExperimentProcesses('lstm_exp9_var_L2')
		
		exp.pp_data.vocabulary_size = 5000
		
		exp.pp_data.embedding_size = 300
		exp.pp_data.max_posts = 1750
		exp.pp_data.max_terms_by_post = 300
		exp.pp_data.binary_classifier = True
		exp.pp_data.format_input_data = dn.InputData.POSTS_ONLY_TEXT
		exp.pp_data.remove_stopwords = False
		exp.pp_data.delete_low_tfid = False
		exp.pp_data.min_df = 0
		exp.pp_data.min_tf = 0
		exp.pp_data.random_posts = False
		exp.pp_data.random_users = False
		exp.pp_data.tokenizing_type = 'WE'
		exp.pp_data.use_embedding = dn.UseEmbedding.STATIC
Beispiel #10
0
def test_optimizer_function(option):
    set_params = dict()

    # change optimizer function
    if option == '1':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [16],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 1\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' +\
           'Optimizer function variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_of', '_glorot', set_params)

    elif option == '2':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAMAX.value],
            'neuronios_by_layer': [16],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 2\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Optimizer function variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_of', '_glorot', set_params)

    elif option == '3':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.NADAM.value],
            'neuronios_by_layer': [16],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 3\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Optimizer function variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_of', '_glorot', set_params)

    elif option == '4':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADADELTA.value],
            'neuronios_by_layer': [16],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 4\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Optimizer function variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_of', '_glorot', set_params)

    elif option == '5':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAGRAD.value],
            'neuronios_by_layer': [16],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 5\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Optimizer function variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_of', '_glorot', set_params)

    # change neuronios by layers
    elif option == '6':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 6\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Neurons by layer variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_nl', '_glorot', set_params)

    elif option == '7':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [64],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 7\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Neurons by layer variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_nl', '_glorot', set_params)

    elif option == '8':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [96],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 8\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Neurons by layer variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_nl', '_glorot', set_params)

    elif option == '9':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [128],
            'hidden_layers': [3],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 9\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Neurons by layer variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_nl', '_glorot', set_params)

    # change hidden layers
    elif option == '10':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 10\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Neurons by layer variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_nl', '_glorot', set_params)

    elif option == '11':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [5],
            'batch_sizes': [40],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 11\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Hidden layer variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_hl', '_glorot', set_params)

    # change batch_size values
    elif option == '12':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [5],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 12\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Batch size variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_bs', '_glorot', set_params)

    elif option == '13':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [10],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 13\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Epochs variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_ep', '_glorot', set_params)

    elif option == '14':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [20],
            'epochs': [32]
        })

        print('Initializer experiment multclass_lstm_model 14\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Epochs variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_mx', '_glorot', set_params)

    # change epochs values
    elif option == '15':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [40],
            'epochs': [64]
        })

        print('Initializer experiment multclass_lstm_model 15\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Epochs variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_mx', '_glorot', set_params)

    elif option == '16':
        set_params.update({
            'optimizer_function': [dn.OptimizerFunction.ADAM.value],
            'neuronios_by_layer': [32],
            'hidden_layers': [4],
            'batch_sizes': [40],
            'epochs': [96]
        })

        print('Initializer experiment multclass_lstm_model 16\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label\n' + \
           'Epochs variation')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=2640,
            subdirectory="anx_dep_multilabel")
        generate_model(exp, 'SMHD_ml_gl_2640_var_mx', '_glorot', set_params)
Beispiel #11
0
"""
    Test Model using RSDD Dataset
"""
import utils.definition_network as dn
import numpy as np

from utils.experiment_processes import ExperimentProcesses
import datetime
# LAYERS
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from network_model.model_class import ModelClass

if __name__ == '__main__':
    exp = ExperimentProcesses('lstm_exp14_L3')

    exp.pp_data.vocabulary_size = 5000

    exp.pp_data.embedding_size = 300
    exp.pp_data.max_posts = 1750
    exp.pp_data.max_terms_by_post = 300
    exp.pp_data.binary_classifier = True
    exp.pp_data.format_input_data = dn.InputData.POSTS_LIST
    exp.pp_data.remove_stopwords = False
    exp.pp_data.delete_low_tfid = False
    exp.pp_data.min_df = 0
    exp.pp_data.min_tf = 0
    exp.pp_data.random_posts = False
    exp.pp_data.random_users = False
    exp.pp_data.tokenizing_type = 'WE'
Beispiel #12
0
"""
    Test Model using RSDD Dataset
"""
import utils.definition_network as dn

from utils.experiment_processes import ExperimentProcesses
import datetime
# LAYERS
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Embedding, TimeDistributed, Input
from keras.layers import LSTM
from network_model.model_class import ModelClass

if __name__ == '__main__':
		exp = ExperimentProcesses('lstm_exp13')
		
		exp.pp_data.vocabulary_size = 5000
		
		exp.pp_data.embedding_size = 300
		exp.pp_data.max_posts = 2000
		exp.pp_data.max_terms_by_post = 400
		exp.pp_data.binary_classifier = True
		exp.pp_data.format_input_data = dn.InputData.POSTS_LIST
		exp.pp_data.remove_stopwords = False
		exp.pp_data.delete_low_tfid = False
		exp.pp_data.min_df = 0
		exp.pp_data.min_tf = 0
		exp.pp_data.random_posts = False
		exp.pp_data.random_users = False
		exp.pp_data.tokenizing_type = 'WE'
Beispiel #13
0
def test(option):
		set_params = dict()

		if option == '1':
				print('Initializer experiment 1 (model SMHD_cnn_lstm_gl_880)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 multi-label')
				exp = ExperimentProcesses('cnn_L1_lstm_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="anxiety,depression")
				generate_model(exp, 'SMHD_cnn_lstm_gl_880', '_glorot', set_params)

		elif option == '2':
				print('Initializer experiment 2 (model SMHD_cnn_lstm_gl_1040)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040 multi-label')
				exp = ExperimentProcesses('cnn_L1_lstm_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="anxiety")
				generate_model(exp, 'SMHD_cnn_lstm_gl_1040', '_glorot', set_params)

		elif option == '3':
				print('Initializer experiment 3 (model SMHD_cnn_lstm_gl_2160)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2160 multi-label')
				exp = ExperimentProcesses('cnn_L1_lstm_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2160, subdirectory="depression")
				generate_model(exp, 'SMHD_cnn_lstm_gl_2160', '_glorot', set_params)

		else: # division test 4 to run in PCAD, with total time experiment not excceding 24h
				if option == '1.1.1':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [64],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '1.1.2':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [64],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '1.1.3':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [64],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '1.1.4':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [64],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
				
				elif option == '1.2.1':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '1.2.2':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '1.2.3':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '1.2.4':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
				
				elif option == '1.3.1':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '1.3.2':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '1.3.3':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '1.3.4':
						set_params.update({'filters_by_layer': [32],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
				
				elif option == '2.1.1':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [64],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '2.1.2':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [64],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '2.1.3':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [64],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '2.1.4':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [64],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
				
				elif option == '2.2.1':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '2.2.2':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '2.2.3':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '2.2.4':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
				
				elif option == '2.3.1':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '2.3.2':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '2.3.3':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '2.3.4':
						set_params.update({'filters_by_layer': [64],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
						
				elif option == '3.1.1':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '3.1.2':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '3.1.3':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '3.1.4':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [128],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
				
				elif option == '3.2.1':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [192],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '3.2.2':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [192],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '3.2.3':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [192],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '3.2.4':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [192],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
				
				elif option == '3.3.1':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.2]})
				
				elif option == '3.3.2':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.2],
															 'dropouts_lstm': [0.5]})
				
				elif option == '3.3.3':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.2]})
				
				elif option == '3.3.4':
						set_params.update({'filters_by_layer': [128],
															 'neuronios_by_lstm_layer': [256],
															 'dropouts': [0.5],
															 'dropouts_lstm': [0.5]})
				
				print('Initializer experiment ' + option + ' (model SMHD_cnn_lstm_gl_2640)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label')
				exp = ExperimentProcesses('cnn_L1_lstm_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2640, subdirectory="anx_dep_multilabel")
				generate_model(exp, 'SMHD_cnn_lstm_gl_2640', '_glorot', set_params)
Beispiel #14
0
def main(arg):
    if arg == '1':
        print('Initializer experiment 1 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [8],
            'epochs': [32],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '2':
        print('Initializer experiment 2 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [8],
            'epochs': [32],
            'batch_sizes': [20],
            'dropouts': [0.2]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '3':
        print('Initializer experiment 3 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [8],
            'epochs': [64],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '4':
        print('Initializer experiment 4 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [8],
            'epochs': [64],
            'batch_sizes': [20],
            'dropouts': [0.2]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '5':
        print('Initializer experiment 5 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [8],
            'epochs': [96],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '6':
        print('Initializer experiment 6 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [8],
            'epochs': [96],
            'batch_sizes': [20],
            'dropouts': [0.2]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '7':
        print('Initializer experiment 7 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [32],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '8':
        print('Initializer experiment 8 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [32],
            'batch_sizes': [20],
            'dropouts': [0.2]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '9':
        print('Initializer experiment 9 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [64],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '10':
        print('Initializer experiment 10 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [64],
            'batch_sizes': [20],
            'dropouts': [0.2]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '11':
        print('Initializer experiment 11 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [96],
            'batch_sizes': [20],
            'dropouts': [0.1]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '12':
        print('Initializer experiment 12 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [16],
            'epochs': [96],
            'batch_sizes': [20],
            'dropouts': [0.2]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '13':
        print('Initializer experiment 13 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [32],
            'epochs': [64, 96],
            'batch_sizes': [20],
            'dropouts': [0.1, 0.2]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)

    elif arg == '14':
        print('Initializer experiment 13 (model SMHD_ml_gl_880_cbow_alluser)\n' + \
           'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880')
        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety', 'depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        set_params = dict({
            'neuronios_by_layer': [64],
            'epochs': [96, 128],
            'batch_sizes': [20],
            'dropouts': [0.1, 0.2]
        })
        load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot',
                              set_params)
Beispiel #15
0
def main(arg):
		if arg == '1':
				print('Initializer experiment 1 (model SMHD_ml_gl_1560)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1560 single-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1560, subdirectory="anx_dep_multilabel")
				generate_model_ml_gl(exp, 'SMHD_ml_gl_1560')
		
		elif arg == '2':
				print('Initializer experiment 2 (model SMHD_ml_le_1560)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1560 single-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1560, subdirectory="anx_dep_multilabel")
				generate_model_ml_le(exp, 'SMHD_ml_le_1560')
		
		elif arg == '3':
				print('Initializer experiment 3 (model SMHD_ml_gl_2640)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2640 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2640, subdirectory="anx_dep_multilabel")
				generate_model_ml_gl(exp, 'SMHD_ml_gl_2640')
		
		elif arg == '4':
				print('Initializer experiment 4 (model SMHD_ml_le_2640)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_2640 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2640, subdirectory="anx_dep_multilabel")
				generate_model_ml_le(exp, 'SMHD_ml_le_2640')
		
		elif arg == '5':
				print('Initializer experiment 5 (model SMHD_ml_gl_1040)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="anxiety")
				generate_model_ml_gl(exp, 'SMHD_ml_gl_1040')
		
		elif arg == '6':
				print('Initializer experiment 6 (model SMHD_ml_le_1040)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_1040 single-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="anxiety")
				generate_model_ml_le(exp, 'SMHD_ml_le_1040')
		
		elif arg == '7':
				print('Initializer experiment 7 (model SMHD_ml_gl_2160)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2160 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2160, subdirectory="depression")
				generate_model_ml_gl(exp, 'SMHD_ml_gl_2160')
		
		elif arg == '8':
				print('Initializer experiment 8 (model SMHD_ml_le_2160)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_2160 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2160, subdirectory="depression")
				generate_model_ml_le(exp, 'SMHD_ml_le_2160')
		
		elif arg == '9':
				print('Initializer experiment 9 (model SMHD_ml_gl_880)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="anxiety,depression")
				generate_model_ml_gl(exp, 'SMHD_ml_gl_880')
		
		elif arg == '10':
				print('Initializer experiment 10 (model SMHD_ml_le_880)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_880 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="anxiety,depression")
				generate_model_ml_le(exp, 'SMHD_ml_le_880')
		
		elif arg == '11':
				print('Initializer experiment 11 (model SMHD_ml_gl_1040)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_1040 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=1040, subdirectory="anxiety")
				load_submodel_anx(exp, 'SMHD_ml_gl_1040_glove_a-d-aduser', '_glorot')
		
		elif arg == '12':
				print('Initializer experiment 12 (model SMHD_ml_gl_2160)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_2160 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2160, subdirectory="depression")
				load_submodel_dep(exp, 'SMHD_ml_gl_2160_cbow_a-d-aduser', '_glorot')
		
		elif arg == '13':
				print('Initializer experiment 13 (model SMHD_ml_gl_880)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="anxiety,depression")
				load_submodel_anx_dep(exp, 'SMHD_ml_gl_880_cbow_alluser', '_glorot')
		
		elif arg == '14':
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=2640, subdirectory="anx_dep_multilabel")
				
				exp.pp_data.embedding_type = dn.EmbeddingType.WORD2VEC_CUSTOM
				exp.pp_data.use_embedding = dn.UseEmbedding.STATIC
				exp.pp_data.word_embedding_custom_file = 'SMHD-CBOW-A-D-ADUsers-300.bin'
				exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL
				
				we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
											 '_EF_' + exp.pp_data.word_embedding_custom_file.split('.')[0] + '_glove6B300d_glorot'
				
				load_best_lstm_mult_label_multi_class(exp, 'exp9_' + we_file_name[0:13] + we_file_name[18:30] + '_2640',
																							we_file_name)

		elif arg == '15':
				mode_matrix_encoding = ["binary", "count", "tfidf", "freq"]
				for mode in mode_matrix_encoding:
						print('Initializer experiment multclass_lstm_model, text matrix enconding mode = ' + mode + '\n' + \
									'Set: kernel_initializer=lecun, dataset=SMHD_1040 multi-label\n')

						exp = ExperimentProcesses('lstm_exp9_var_L3')
						exp.pp_data.text_matrix_enconding = True
						exp.mode_text_matrix_enconding = mode

						exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																					 total_registers=1040, subdirectory="anxiety")
						generate_model_ml_le(exp, 'SMHD_ml_le_1040_tme_'+mode)

		elif arg == '16':
				print('Initializer experiment 16 (model SMHD_ml_le_880)\n' + \
							'Set: kernel_initializer=lecun_uniform, dataset=SMHD_880 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="anxiety,depression")
				generate_model_ml_le(exp, 'SMHD_ml_le_880')

		elif arg == '17':
				print('Initializer experiment 9 (model SMHD_ml_gl_880)\n' + \
							'Set: kernel_initializer=glorot_uniform=xavier_uniform, dataset=SMHD_880 multi-label')
				exp = ExperimentProcesses('lstm_exp9_var_L3')
				exp.pp_data.set_dataset_source(dataset_name='SMHD', label_set=['control', 'anxiety', 'depression'],
																			 total_registers=880, subdirectory="anxiety,depression")
				generate_model_ml_gl(exp, 'SMHD_ml_gl_880')
def main():
    for arg in sys.argv[1]:
        if arg == '1':
            print(
                'Initializer experiment 1 - model SMHD_anx_dep_multilabel_nv_1'
            )
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety', 'depression'],
                total_registers=3160,
                subdirectory="anx_dep_multilabel")
            generate_model_nv_1(exp, 'SMHD_anx_dep_multilabel_nv_1')

        elif arg == '2':
            print(
                'Initializer experiment 2 - model SMHD_anx_dep_multilabel_nv_2'
            )
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety', 'depression'],
                total_registers=3160,
                subdirectory="anx_dep_multilabel")
            generate_model_nv_2(exp, 'SMHD_anx_dep_multilabel_nv_2')

        elif arg == '3':
            print(
                'Initializer experiment 1 - model SMHD_anx_dep_multilabel_wv_1'
            )
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety', 'depression'],
                total_registers=3160,
                subdirectory="anx_dep_multilabel")
            generate_model_wv_1(exp, 'SMHD_anx_dep_multilabel_wv_1')

        elif arg == '4':
            print(
                'Initializer experiment 2 - model SMHD_anx_dep_multilabel_wv_2'
            )
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety', 'depression'],
                total_registers=3160,
                subdirectory="anx_dep_multilabel")
            generate_model_wv_2(exp, 'SMHD_anx_dep_multilabel_wv_2')

        elif arg == '5':
            print(
                'Initializer experiment 1 - model SMHD_anx_dep_singlelabel_wv_1'
            )
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety', 'depression'],
                total_registers=3160,
                subdirectory="anx_dep_multilabel")
            generate_model_sl_wv_1(exp, 'SMHD_anx_dep_singlelabel_wv_1')

        elif arg == '6':
            print(
                'Initializer experiment 1 - model SMHD_anx_dep_singlelabel_wv_2'
            )
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety', 'depression'],
                total_registers=3160,
                subdirectory="anx_dep_multilabel")
            generate_model_sl_wv_2(exp, 'SMHD_anx_dep_singlelabel_wv_2')

        elif arg == '7':
            print(
                'Initializer experiment 1 - model SMHD_anx_dep_singlelabel_wv_4'
            )
            exp = ExperimentProcesses('lstm_exp9_var_L3')
            exp.pp_data.set_dataset_source(
                dataset_name='SMHD',
                label_set=['control', 'anxiety', 'depression'],
                total_registers=3160,
                subdirectory="anx_dep_multilabel")
            SMHD_anx_dep_singlelabel_wv_4(exp, 'SMHD_anx_dep_singlelabel_wv_4')
Beispiel #17
0
"""
    Test Model using RSDD Dataset
"""
import utils.definition_network as dn

from utils.experiment_processes import ExperimentProcesses
import datetime
# LAYERS
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Embedding, TimeDistributed, Input
from keras.layers import LSTM
from network_model.model_class import ModelClass

if __name__ == '__main__':
		exp = ExperimentProcesses('lstm_exp7_2')
		
		exp.pp_data.vocabulary_size = 5000
		
		exp.pp_data.embedding_size = 300
		exp.pp_data.max_posts = 1750
		exp.pp_data.max_terms_by_post = 300
		exp.pp_data.binary_classifier = True
		exp.pp_data.format_input_data = dn.InputData.POSTS_ONLY_TEXT
		exp.pp_data.remove_stopwords = False
		exp.pp_data.delete_low_tfid = False
		exp.pp_data.min_df = 0
		exp.pp_data.min_tf = 0
		exp.pp_data.random_posts = False
		exp.pp_data.random_users = False
		exp.pp_data.tokenizing_type = 'WE'
Beispiel #18
0
def generate_anx_dep_model(arg):
    if arg == '1':
        print('Initializer experiment WE anx_dep 1 (model SMHD_ml_gl_880)\n' + \
              'Set: dataset=SMHD_880 single-label SMHD-Skipgram-A-D-ADUsers-300.bin Static')

        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety,depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        exp.pp_data.embedding_type = dn.EmbeddingType.WORD2VEC_CUSTOM
        exp.pp_data.use_embedding = dn.UseEmbedding.STATIC
        exp.pp_data.word_embedding_custom_file = 'SMHD-Skipgram-A-D-ADUsers-300.bin'
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL

        we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
                       '_EF_' + exp.pp_data.word_embedding_custom_file.split('.')[0] + '_lecun'

        generate_model(
            exp, 'exp9_' + we_file_name[0:13] + we_file_name[18:30] + '_880',
            we_file_name)

    elif arg == '2':
        print('Initializer experiment WE anx_dep 2 (model SMHD_ml_gl_880)\n' + \
              'Set: dataset=SMHD_880 single-label SMHD-Skipgram-A-D-ADUsers-300.bin Non-Static')

        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety,depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        exp.pp_data.embedding_type = dn.EmbeddingType.WORD2VEC_CUSTOM
        exp.pp_data.use_embedding = dn.UseEmbedding.NON_STATIC
        exp.pp_data.word_embedding_custom_file = 'SMHD-Skipgram-A-D-ADUsers-300.bin'
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL

        we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
                       '_EF_' + exp.pp_data.word_embedding_custom_file.split('.')[0] + '_lecun'

        generate_model(
            exp, 'exp9_' + we_file_name[0:13] + we_file_name[18:30] + '_880',
            we_file_name)

    elif arg == '3':
        print('Initializer experiment WE anx_dep 3 (model SMHD_ml_gl_880)\n' + \
              'Set: dataset=SMHD_880 single-label SMHD-CBOW-A-D-ADUsers-300.bin Static')

        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety,depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        exp.pp_data.embedding_type = dn.EmbeddingType.WORD2VEC_CUSTOM
        exp.pp_data.use_embedding = dn.UseEmbedding.STATIC
        exp.pp_data.word_embedding_custom_file = 'SMHD-CBOW-A-D-ADUsers-300.bin'
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL

        we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
                       '_EF_' + exp.pp_data.word_embedding_custom_file.split('.')[0] + '_lecun'

        generate_model(
            exp, 'exp9_' + we_file_name[0:13] + we_file_name[18:30] + '_880',
            we_file_name)

    elif arg == '4':
        print('Initializer experiment WE anx_dep 4 (model SMHD_ml_gl_880)\n' + \
              'Set: dataset=SMHD_880 single-label SMHD-CBOW-A-D-ADUsers-300.bin Non-Static')

        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety,depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        exp.pp_data.embedding_type = dn.EmbeddingType.WORD2VEC_CUSTOM
        exp.pp_data.use_embedding = dn.UseEmbedding.NON_STATIC
        exp.pp_data.word_embedding_custom_file = 'SMHD-CBOW-A-D-ADUsers-300.bin'
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL

        we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
                       '_EF_' + exp.pp_data.word_embedding_custom_file.split('.')[0] + '_lecun'

        generate_model(
            exp, 'exp9_' + we_file_name[0:13] + we_file_name[18:30] + '_880',
            we_file_name)

    elif arg == '5':
        print('Initializer experiment WE anx_dep 5 (model SMHD_ml_gl_880)\n' + \
              'Set: dataset=SMHD_880 single-label SMHD-glove-A-D-ADUsers-300.pkl Static')

        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety,depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        exp.pp_data.embedding_type = dn.EmbeddingType.GLOVE_CUSTOM
        exp.pp_data.use_embedding = dn.UseEmbedding.STATIC
        exp.pp_data.word_embedding_custom_file = 'SMHD-glove-A-D-ADUsers-300.pkl'
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL

        we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
                       '_EF_' + exp.pp_data.word_embedding_custom_file.split('.')[0] + '_lecun'

        generate_model(
            exp, 'exp9_' + we_file_name[0:13] + we_file_name[18:30] + '_880',
            we_file_name)

    elif arg == '6':
        print('Initializer experiment WE anx_dep 6 (model SMHD_ml_gl_880)\n' + \
              'Set: dataset=SMHD_880 single-label SMHD-glove-A-D-ADUsers-300.pkl Non-Static')

        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety,depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        exp.pp_data.embedding_type = dn.EmbeddingType.GLOVE_CUSTOM
        exp.pp_data.use_embedding = dn.UseEmbedding.NON_STATIC
        exp.pp_data.word_embedding_custom_file = 'SMHD-glove-A-D-ADUsers-300.pkl'
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL

        we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
                       '_EF_' + exp.pp_data.word_embedding_custom_file.split('.')[0] + '_lecun'

        generate_model(
            exp, 'exp9_' + we_file_name[0:13] + we_file_name[18:30] + '_880',
            we_file_name)

    elif arg == '7':
        print('Initializer experiment WE anx_dep 7 (model SMHD_ml_gl_880)\n' + \
              'Set: dataset=SMHD_880 single-label SMHD-CBOW-AllUsers-300.pkl Non-Static')

        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety,depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        exp.pp_data.embedding_type = dn.EmbeddingType.WORD2VEC
        exp.pp_data.use_embedding = dn.UseEmbedding.NON_STATIC
        exp.pp_data.word_embedding_custom_file = 'SMHD-CBOW-AllUsers-300.pkl'
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL

        we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
                       '_EF_' + exp.pp_data.word_embedding_custom_file.split('.')[0] + '_lecun'

        generate_model(
            exp, 'SMHD_anx_dep_3_' + we_file_name[0:13] + we_file_name[18:30] +
            '_880', we_file_name)

    else:
        print('Initializer experiment WE anx_dep - (model SMHD_ml_gl_880)\n' + \
              'Set: dataset=SMHD_880 single-label Glove6B Static')

        exp = ExperimentProcesses('lstm_exp9_var_L3')
        exp.pp_data.set_dataset_source(
            dataset_name='SMHD',
            label_set=['control', 'anxiety,depression'],
            total_registers=880,
            subdirectory="anxiety,depression")

        exp.pp_data.embedding_type = dn.EmbeddingType.GLOVE_6B
        exp.pp_data.use_embedding = dn.UseEmbedding.STATIC
        exp.pp_data.word_embedding_custom_file = ''
        exp.pp_data.load_dataset_type = dn.LoadDataset.TRAIN_DATA_MODEL

        we_file_name = 'ET_' + str(exp.pp_data.embedding_type.value) + '_UE_' + str(exp.pp_data.use_embedding.value) + \
                       '_lecun'

        generate_model(exp, 'exp9_' + 'glove6B' + '_880', we_file_name)