We're finally ready to train our sequence-to-sequence network. The following code makes calls to all our data loading functions first, creates our callbacks, and then fits the model:
data = load_data()data = one_hot_vectorize(data)callbacks = create_callbacks("char_s2s")model, encoder_model, decoder_model = build_models(256, data['num_encoder_tokens'], data['num_decoder_tokens'])print(model.summary())model.fit(x=[data["encoder_input_data"], data["decoder_input_data"]], y=data["decoder_target_data"], batch_size=64, epochs=100, validation_split=0.2, callbacks=callbacks)model.save('char_s2s_train.h5')encoder_model.save('char_s2s_encoder.h5')decoder_model.save('char_s2s_decoder.h5')
You'll note that I previously haven't defined a validation ...