Skip to content

Instantly share code, notes, and snippets.

@netsatsawat
Created June 18, 2019 06:16
Show Gist options
  • Save netsatsawat/999baa914586d736fba9432f698384e4 to your computer and use it in GitHub Desktop.
Save netsatsawat/999baa914586d736fba9432f698384e4 to your computer and use it in GitHub Desktop.
Train the malaria model
sess = K.get_session()
init = tf.global_variables_initializer()
sess.run(init)
STEP_SIZE_TRAIN = training_generator.samples // training_generator.batch_size
STEP_SIZE_VALID = validatation_generator.n // validatation_generator.batch_size
training_stats = CollectStats()
history = malaria_model.fit_generator(training_generator,
epochs=50,
steps_per_epoch=STEP_SIZE_TRAIN,
validation_data=validatation_generator,
validation_steps=STEP_SIZE_VALID,
callbacks=[training_stats, early_stopping,
checkpoint, reduce_lr])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment