x = Dropout(0.5)(x) // and dropout here.
x = Dense(1, activation="sigmoid")(x)
model = Model(inputs=[i], outputs=[x])
if os.path.exists("tcn.npz"):
// Load checkpoint if file exists.
w = np.load("tcn.npz", allow_pickle=True)["w"]
print("Model reloaded.")
model.set_weights(w.tolist())
else:
// Save the checkpoint.
w = np.array(model.get_weights())
np.savez_compressed(file="tcn.npz", w=w, allow_pickle=True)
print("First time.")
// Make inference.