Skip to content

Commit

Permalink
Fix metrics save frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
takuseno committed Jan 28, 2021
1 parent 0d91df6 commit b6c9b69
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions d3rlpy/online/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ def train_single_env(
if eval_scorer:
logger.add_metric("evaluation", eval_scorer(algo))

# save metrics
logger.commit(epoch, total_step)

if epoch % save_interval == 0:
# save metrics
logger.commit(epoch, total_step)
logger.save_model(total_step, algo)


Expand Down Expand Up @@ -424,9 +425,10 @@ def train_batch_env(
if eval_scorer:
logger.add_metric("evaluation", eval_scorer(algo))

# save metrics
logger.commit(epoch, total_step)

if epoch % save_interval == 0:
# save metrics
logger.commit(epoch, total_step)
logger.save_model(total_step, algo)

# finish all process
Expand Down

0 comments on commit b6c9b69

Please sign in to comment.