13from tensorflow.keras.models
import Sequential
14from tensorflow.keras.layers
import Dense, Activation
15from tensorflow.keras.regularizers
import l2
16from tensorflow.keras.optimizers
import SGD
17from tensorflow.keras.utils
import plot_model
23nodes_hidden_layer = 64
30model.add(Dense(nodes_hidden_layer, activation=
'relu', kernel_regularizer=l2(l2_val), input_dim=num_input_nodes))
34for k
in range(num_hidden_layers-1):
35 model.add(Dense(nodes_hidden_layer, activation=
'relu', kernel_regularizer=l2(l2_val)))
42model.add(Dense(num_output_nodes, activation=
'softmax'))
48model.compile(loss=
'categorical_crossentropy', optimizer=SGD(learning_rate=0.01), weighted_metrics=[
'accuracy',])
61 plot_model(model, to_file=
'model.png', show_shapes=
True)
63 print(
'[INFO] Failed to make model plot')