13from keras.models
import Sequential
14from keras.layers.core
import Dense, Activation
15from keras.regularizers
import l2
16from keras.optimizers
import SGD
22nodes_hidden_layer = 64
29model.add(Dense(nodes_hidden_layer, activation=
'relu', W_regularizer=l2(l2_val), input_dim=num_input_nodes))
33for k
in range(num_hidden_layers-1):
34 model.add(Dense(nodes_hidden_layer, activation=
'relu', W_regularizer=l2(l2_val)))
41model.add(Dense(num_output_nodes, activation=
'softmax'))
47model.compile(loss=
'categorical_crossentropy', optimizer=SGD(lr=0.01), metrics=[
'accuracy',])
60 from keras.utils.visualize_util
import plot
61 plot(model, to_file=
'model.png', show_shapes=
True)
63 print(
'[INFO] Failed to make model plot')