print("Execution time to fit 500 epochs: %s seconds" % (end_time[4] - start_time[4]))
Execution time to fit 500 epochs: 45.60540843009949 seconds
fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, sharex=True, figsize=(16, 5))
nn_plot(hist[4], 400, subplot=ax1, loss=True, title="Reference: minibatch 10 samples")
nn_plot(hist[8], 400, subplot=ax2, loss=True, title="minibatch 64 samples")
fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, sharex=True, figsize=(16, 5))
nn_plot(hist[4], 400, subplot=ax1, acc=True, title="Reference: minibatch 10 samples")
nn_plot(hist[8], 400, subplot=ax2, acc=True, title="minibatch 64 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])