def train_model(self):
Train the model with dataset and return the minimum_loss
self.training_losses = []
self._no_improvement_count = 0
self.minimum_loss = float("inf")
batch_size = min(self.x_train.shape[0], 200)
if constant.DATA_AUGMENTATION:
After Change
Train the model with dataset and return the minimum_loss
batch_size = min(self.x_train.shape[0], constant.MAX_BATCH_SIZE)
terminator = EarlyStop()
lr_scheduler = LearningRateScheduler(lr_schedule)
lr_reducer = ReduceLROnPlateau(factor=np.sqrt(0.1),
cooldown=0,
patience=5,
min_lr=0.5e-6)
callbacks = [terminator, lr_scheduler, lr_reducer]
if constant.LIMIT_MEMORY:
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)