Ejemplo n.º 1
0
def predict(dataset):
    print 'STEP 4 start...'
    train_rnnrbm(dataset=dataset,
                 hidden_layers_sizes=params['STEP4']['hidden_layers_size'],
                 hidden_recurrent=params['STEP4']['hidden_recurrent'],
                 pretrain_lr=params['STEP4']['pretrain']['learning_rate'],
                 pretrain_batch_size=params['STEP4']['pretrain']['batch_size'],
                 pretrain_epochs=params['STEP4']['pretrain']['epochs'],
                 finetune_lr=params['STEP4']['finetune']['learning_rate'],
                 finetune_batch_size=params['STEP4']['finetune']['batch_size'],
                 finetune_epochs=params['STEP4']['finetune']['epochs'])
Ejemplo n.º 2
0
def predict(dataset):
    print 'STEP 4 start...'
    train_rnnrbm(dataset=dataset,
        hidden_layers_sizes=params['STEP4']['hidden_layers_size'],
        hidden_recurrent = params['STEP4']['hidden_recurrent'],
        pretrain_lr=params['STEP4']['pretrain']['learning_rate'],
        pretrain_batch_size=params['STEP4']['pretrain']['batch_size'],
        pretrain_epochs=params['STEP4']['pretrain']['epochs'],
        finetune_lr=params['STEP4']['finetune']['learning_rate'],
        finetune_batch_size=params['STEP4']['finetune']['batch_size'],
        finetune_epochs=params['STEP4']['finetune']['epochs']
    )
Ejemplo n.º 3
0
     'learning_rate']:
 for epochs_pretrain in params['STEP4']['pretrain'][
         'epochs']:
     for batch_size_finetune in params['STEP4'][
             'finetune']['batch_size']:
         for learning_rate_finetune in params['STEP4'][
                 'finetune']['learning_rate']:
             for epochs_finetune in params['STEP4'][
                     'finetune']['epochs']:
                 result = train_rnnrbm(
                     dataset=dataset,
                     hidden_layers_sizes=
                     hidden_layers_sizes,
                     hidden_recurrent=hidden_recurrent,
                     pretrain_lr=learning_rate_pretrain,
                     pretrain_batch_size=
                     batch_size_pretrain,
                     pretrain_epochs=epochs_pretrain,
                     finetune_lr=learning_rate_finetune,
                     finetune_batch_size=
                     batch_size_finetune,
                     finetune_epochs=epochs_finetune)
                 i += 1
                 print '%d / %d is done...' % (i,
                                               all_size)
                 out = open(model_dirs['STEP4_logs'],
                            'a')
                 out.write(
                     '%f,%s,%s,%s,%d,%f,%d,%d,%f,%d\n' %
                     (result, brandcode,
                      str(hidden_layers_sizes),