Exemplo n.º 1
0
    params['normalise_data'] = 4 # adding more values to params, what does this value signify? #
    params['reset_state']=res # adding more values to params, what does this value signify? #
    params['seq_length']=seq # adding more values to params, what does this value signify? #
    params["reload_data"] = 0 # adding more values to params, what does this value signify? #
    params = config.update_params(params) # New param values are updated#
    #params["model"] = "kfl_QRf"
    if params["model"] == "lstm":
        Model = lstm(params=params)
    elif params["model"] == "kfl_QRf":
        Model = kfl_QRf(params=params)
    elif params["model"] == "kfl_Rf":
        Model = kfl_Rf(params=params)
    elif params["model"] == "kfl_QRFf":
        Model = kfl_QRFf(params=params)
    elif params["model"] == "kfl_K":
        Model = kfl_K(params=params)
    params["rn_id"]="dobuleloss081500_nrm4_seq%i_res%i_keep%f_lr%f"%(seq,res,rnn_keep_prob,params["lr"]) # adding more values to params, what does this value signify? #
    params=config.update_params(params) # New param values are updated#
#    (params, X_train, Y_train, F_list_train, G_list_train, S_Train_list, R_L_Train_list,
#             X_test, Y_test, F_list_test, G_list_test, S_Test_list, R_L_Test_list) = \
#            dut.prepare_training_set(params) # This is where the observation set will be given#
    show_every = 1
    #(index_train_list, S_Train_list) = dut.get_seq_indexes(params, S_Train_list)
    #(index_test_list, S_Test_list) = dut.get_seq_indexes(params, S_Test_list)
    batch_size = params['batch_size']
    #n_train_batches = len(index_train_list)
    #n_train_batches /= batch_size

    #n_test_batches = len(index_test_list)
    #n_test_batches /= batch_size
    #params['training_size'] = len(X_train) * params['seq_length']
Exemplo n.º 2
0
                    params['Qn_hidden'] = h
                    params['Rn_hidden'] = h
                    params['Kn_hidden'] = h

                    if params["model"] == "lstm":
                        tracker = lstm(params=params)
                    elif params["model"] == "kfl_QRf":
                        tracker = kfl_QRf(params=params)
                    elif params["model"] == "kfl_Rf":
                        tracker = kfl_Rf(params=params)
                    elif params["model"] == "kfl_f":
                        tracker = kfl_f(params=params)
                    elif params["model"] == "kfl_QRFf":
                        tracker = kfl_QRFf(params=params)
                    elif params["model"] == "kfl_K":
                        tracker = kfl_K(params=params)
                    params = config.update_params(params)

                    show_every = 1

                    ut.start_log(params)
                    ut.log_write("Model training started", params)
                    median_result_lst, mean_result_lst = train(tracker, params)
                    # if params["data_mode"]=="David":
                    #     np.savetxt('/home/coskun/PycharmProjects/poseft/trials/res/'+params["sequence"]+'/'+msg,mean_result_lst)
                    # else:
                    # np.savetxt('/home/coskun/PycharmProjects/poseft/trials/res/klstm/'+params["sequence"]+'/'+msg,median_result_lst)
                    # np.min(median_result_lst,axis=1)
                    # print median_result_lst
                    # print mean_result_lst
                    # print 'Min...'