Skip to content

Commit

Permalink
Implement in
Browse files Browse the repository at this point in the history
  • Loading branch information
notadamking committed Jul 4, 2019
1 parent f9fa7ec commit d81b2f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/RLTrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ def train(self, n_epochs: int = 100, save_every: int = 10, test_trained_model: b

model.learn(total_timesteps=steps_per_epoch)

model_path = path.join('data', 'agents', f'{self.study_name}__{model_epoch}.pkl')
model.save(model_path)
if model_epoch % save_every == 0:
model_path = path.join('data', 'agents', f'{self.study_name}__{model_epoch}.pkl')
model.save(model_path)

if test_trained_model:
self.test(model_epoch, should_render=render_trained_model)
Expand Down

0 comments on commit d81b2f9

Please sign in to comment.