Skip to content

Instantly share code, notes, and snippets.

@adriaciurana
Last active January 23, 2019 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adriaciurana/f99dc78146695300bfb5db17a4d34d62 to your computer and use it in GitHub Desktop.
Save adriaciurana/f99dc78146695300bfb5db17a4d34d62 to your computer and use it in GitHub Desktop.
Articulo Medium 4
# Usamos fit generator para aprender.
# Definimos 50 epocas y 2000 iteraciones/epoca
# Indicamos que datos usaremos para validar el correcto aprendizaje y diagnostico
model.fit_generator(
train_generator,
steps_per_epoch=2000,
epochs=50,
validation_data=val_generator,
validation_steps=800)
# Guardamos el modelo
model_json = model.to_json()
with open('model.json', 'w') as json_file:
json_file.write(model_json)
model.save_weights('model.h5')
print("Guardado con exito.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment