-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Added logging per Brain of time to update policy, time elapsed during training, time to collect experiences, buffer length, average return per policy #1858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Added logging per Brain of time to update policy, time elapsed during…
… training, time to collect experiences, buffer length, average return
- Loading branch information
commit 4849ef0e188775f51e5351a87634f9ecf8a74f5b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
# Contains an implementation of Behavioral Cloning Algorithm | ||
|
||
import logging | ||
import os | ||
|
||
import numpy as np | ||
import tensorflow as tf | ||
|
@@ -19,7 +18,8 @@ | |
class BCTrainer(Trainer): | ||
"""The BCTrainer is an implementation of Behavioral Cloning.""" | ||
|
||
def __init__(self, brain, trainer_parameters, training, load, seed, run_id): | ||
def __init__(self, brain, trainer_parameters, training, load, seed, | ||
run_id): | ||
""" | ||
Responsible for collecting experiences and training PPO model. | ||
:param trainer_parameters: The parameters for the trainer (dictionary). | ||
|
@@ -28,22 +28,20 @@ def __init__(self, brain, trainer_parameters, training, load, seed, run_id): | |
:param seed: The seed the model will be initialized with | ||
:param run_id: The The identifier of the current run | ||
""" | ||
super(BCTrainer, self).__init__(brain, trainer_parameters, training, run_id) | ||
super(BCTrainer, self).__init__(brain, trainer_parameters, training, | ||
run_id) | ||
self.policy = BCPolicy(seed, brain, trainer_parameters, load) | ||
self.n_sequences = 1 | ||
self.cumulative_rewards = {} | ||
self.episode_steps = {} | ||
self.stats = {'Losses/Cloning Loss': [], 'Environment/Episode Length': [], | ||
'Environment/Cumulative Reward': []} | ||
|
||
self.summary_path = trainer_parameters['summary_path'] | ||
self.batches_per_epoch = trainer_parameters['batches_per_epoch'] | ||
if not os.path.exists(self.summary_path): | ||
os.makedirs(self.summary_path) | ||
|
||
|
||
self.demonstration_buffer = Buffer() | ||
self.evaluation_buffer = Buffer() | ||
self.summary_writer = tf.summary.FileWriter(self.summary_path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you test that BC is still training and logging tensorboard ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just tried it, looks like it is still running and logging |
||
|
||
@property | ||
def parameters(self): | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.