예제 #1
0
# Create the model

exp_no = 1

num_input_channels = num_string_inps
num_LSTM_layers = [2, 2, 2, 2]
num_LSTM_units = [[16, 16], [16, 16], [16, 16], [16, 16]]
num_dense_layers = 2
num_dense_units = [10, 5]
# Last dense units always has to be number of risk categories (5)
learning_rate = 10**(-2)
inp_optim = "Adam"
reg_param = 0
batch_sz = 256
eps = 100
val_splt = 0

input_shapes = []
for i_inp in range(num_input_channels):

    input_shapes.append(encoded_col[i_inp].shape)
#print(input_shapes[1][1])

model = back_end.create_model(num_input_channels, input_shapes,
                              num_LSTM_layers, num_LSTM_units,
                              num_dense_layers, num_dense_units, learning_rate,
                              reg_param, inp_optim)

back_end.train_model(batch_sz, eps, val_splt, model, input_list, output_list,
                     exp_no)
# coding: utf-8

# In[1]:


import os
from os import sys, path
sys.path.append(r'/home/saakaar/Desktop/Neural Networks/All_data')


# In[2]:


import back_end


# In[3]:


model=back_end.build_model(3,1,'adam','mse')


# In[4]:


model=back_end.train_model(252,25000,0.15,model)