save_model(tensor_params_list=generator_params + generator_entropy_params+ energy_params, save_to=save_as) if __name__=="__main__": model_config_dict = OrderedDict() model_config_dict['batch_size'] = 128 model_config_dict['num_display'] = 16*16 model_config_dict['hidden_distribution'] = 1. model_config_dict['epochs'] = 200 ################# # LOAD DATA SET # ################# _ , data_stream = bedroom(batch_size=model_config_dict['batch_size']) expert_size_list = [1024] hidden_size_list = [100] num_filters_list = [128] lr_list = [1e-3] lambda_eng_list = [1e-10] lambda_gen_list = [1e-10] for lr in lr_list: for num_filters in num_filters_list: for hidden_size in hidden_size_list: for expert_size in expert_size_list: for lambda_eng in lambda_eng_list: for lambda_gen in lambda_gen_list: model_config_dict['hidden_size'] = hidden_size
if batch_count%1000==0: # sample data save_as = samples_dir + '/' + model_name + '_SAMPLES{}.png'.format(batch_count) sample_data = sampling_function(fixed_hidden_data)[0] sample_data = np.asarray(sample_data) color_grid_vis(inverse_transform(sample_data).transpose([0,2,3,1]), (16, 16), save_as) np.save(file=samples_dir + '/' + model_name +'_MOMENT_COST', arr=np.asarray(moment_cost_list)) if __name__=="__main__": batch_size = 128 num_epochs = 100 _ , data_stream = bedroom(batch_size=batch_size) num_hiddens = 100 learning_rate = 1e-3 l2_weight = 1e-10 generator_optimizer = Adagrad(lr=sharedX(learning_rate), regularizer=Regularizer(l2=l2_weight)) model_test_name = model_name \ + '_HIDDEN{}'.format(int(num_hiddens)) \ + '_REG{}'.format(int(-np.log10(l2_weight))) \ + '_LR{}'.format(int(-np.log10(learning_rate))) \ train_model(model_name=model_test_name,