Skip to content

Commit

Permalink
Dev icenet-ai#252: fixing missing validation steps and learning rate …
Browse files Browse the repository at this point in the history
…decay defaulting incorrectly
  • Loading branch information
JimCircadian committed May 28, 2024
1 parent 63d5e03 commit 77f211c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions icenet/model/networks/tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self,
checkpoint_monitor: str = None,
early_stopping_patience: int = 0,
data_queue_size: int = 10,
lr_decay: tuple = (0, 0, 0),
lr_decay: tuple = (1.0, 0, 0),
pre_load_path: str = None,
strategy: str = None,
tensorboard_logdir: str = None,
Expand Down Expand Up @@ -128,7 +128,7 @@ def get_default_callbacks(self):
patience=self._early_stopping_patience,
baseline=None))

if self._lr_decay[0] > 0:
if self._lr_decay[0] != 1.0:
logging.info("ADding LearningRateScheduler callback")
lr_decay = -0.1 * np.log(self._lr_decay[0])

Expand Down Expand Up @@ -194,6 +194,7 @@ def train(self,
validation_data=validation_dataset.repeat(),
max_queue_size=self._data_queue_size,
steps_per_epoch=self.dataset.counts["train"] // (self.dataset.batch_size * hvd.size()),
validation_steps=self.dataset.counts["val"] // (self.dataset.batch_size * hvd.size()),
)

if save:
Expand Down

0 comments on commit 77f211c

Please sign in to comment.