print("Execution time to fit 500 epochs: %s seconds" % (end_time[3] - start_time[3]))
Execution time to fit 500 epochs: 58.65370726585388 seconds
fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, sharex=True, figsize=(16, 5))
nn_plot(hist[4], 300, subplot=ax1, loss=True, title="Reference: minibatch 10 samples")
nn_plot(hist[7], 300, subplot=ax2, loss=True, title="minibatch 32 samples")
fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, sharex=True, figsize=(16, 5))
nn_plot(hist[4], 300, subplot=ax1, acc=True, title="Reference: minibatch 10 samples")
nn_plot(hist[7], 300, subplot=ax2, acc=True, title="minibatch 32 samples")
model.append(tf.keras.models.Sequential([
tf.keras.layers.Dense(30, kernel_regularizer=tf.keras.regularizers.l2(0.01),
activation=tf.nn.sigmoid, input_shape=(784,), name='hidden_1_layer'),
tf.keras.layers.Dense(10, activation='softmax', name='output_layer')
]))
nn_compile(model[-1], params[-1])