-
Notifications
You must be signed in to change notification settings - Fork 15
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
[Small PR] Logging dir and buffer outputs: fix issue and improvements #322
Conversation
gflownet/utils/buffer.py
Outdated
data_path=None, | ||
train=None, | ||
test=None, | ||
logger=None, | ||
**kwargs, | ||
): | ||
self.logger = logger | ||
self.datadir = logger.datadir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger
defaults to None
, if this is allowed it should be handled here; otherwise make it required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, done here: f8c235c
if "path" in logdir: | ||
self.logdir = Path(logdir.path) | ||
else: | ||
self.logdir = Path(logdir.root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? It seems very arbitrary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's strictly needed but it's additional flexibility. Currently, logdir.path
is created in main.py
, but this will make it still work if the code is run from a different script that does not do that.
Note for reviewers: There are many files changed but it's mostly the same change applied to many config files.
This PR fixes an issue introduced in a recent PR and makes various changes to hopefully improve the handling of the logging directory and the buffer output files:
main.py
to make the actual logging directory be Hydra's output directory. Let's call this directory/log/dir/
, which will be stored inconfig.logger.logdir.path
/log/dir/data/
(as well as a /log/dir/ckpts/`) meant to store the replay buffer, the train data and the test data.env.buffer.train.output_csv
andenv.buffer.train.output_pkl
(and the test counterparts) in order to make use of the buffer. This simplifies its use and the code. And the replay, train and test output files will always be stored simply as/log/dir/data/replay.pkl
,/log/dir/data/train.csv
,/log/dir/data/train.pkl
, etc.