Ejemplo n.º 1
0
          epochs = mc_epochs,
          validation_data = valid_gen,
          steps_per_epoch = tsteps,
          validation_steps = vsteps,
          callbacks = [check_point, early_stop, csv_logger, lr_schedule.lr_scheduler()])

train_end_time = time.time()
m.sec_to_time_elapsed(train_end_time, train_start_time)



### Model Evaluation
###############################################################################
# Training Progress
m.plot_training_progress(csv_file_path = mc_csv_log_save_name,
                         train_metric = 'loss',
                         validation_metric = 'val_loss')


# Predict with Model on Test Set
saved_model = keras.models.load_model(mc_model_save_name)
pred_values = model.predict(test_x)





plot_i = 150
imm.plot_image_bounding_box(img_arr = test_x[plot_i],
                            xmin = [pred_values[plot_i][0]],
                            xmax = [pred_values[plot_i][1]],
Ejemplo n.º 2
0
          steps_per_epoch=tsteps,
          validation_steps=vsteps,
          callbacks=[
              check_point, early_stop, csv_logger,
              lr_schedule.lr_scheduler()
          ],
          class_weight=class_weight_dict)

train_end_time = time.time()
m.sec_to_time_elapsed(train_end_time, train_start_time)

### Plot Model Progress
###############################################################################
# Accuracy
m.plot_training_progress(csv_file_path=m.config_csv_save_name,
                         train_metric='categorical_accuracy',
                         validation_metric='val_categorical_accuracy')

# Entropy (Loss)
m.plot_training_progress(csv_file_path=m.config_csv_save_name,
                         train_metric='loss',
                         validation_metric='val_loss')

### Model Test Set Prediction
###############################################################################
# Predict with Model on Test Set
saved_model = keras.models.load_model(m.config_model_save_name)
pred_values = model.predict(test_x)

# Accuracy on Test Set
true_pos = [