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
BIG PR: Simplification and homegenisation of environments, addition of tests, other clean up changes #101
Conversation
…y unrelated assertion error
Regarding the aptamers bullet point, I have created a |
Oh I didn't know you had done this already - that's great, thanks! |
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.
Doesn't have to be a part of this PR, but I think it's time to group envs related to crystal generation into a single directory.
parents_a: Optional[List] = None, | ||
) -> List: | ||
""" | ||
Returns a list of length the action space with values: |
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.
Could use argument description in docstring (in particular for parent_a
).
""" | ||
Resets the environment. | ||
""" | ||
self.state = [] | ||
self.state = self.source.copy() |
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.
I'd like to have it as a method, smth like self.get_source(reset=True)
to accommodate scenario when we start from random state
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.
Yes, to be done when needed 👍
Co-authored-by: Alexandra <alexandra.volokhova@mila.quebec>
Co-authored-by: Alexandra <alexandra.volokhova@mila.quebec>
Co-authored-by: Michał Koziarski <michal.koziarski@gmail.com>
Co-authored-by: Michał Koziarski <michal.koziarski@gmail.com>
python -m pytest tests/gflownet/envs/
black .
isort .
It's quite a massive PR and it's hard to mention all changes, but here is a non-exhaustive list of things:
base.py
) andsuper()
is called at the end of the init.kwargs
.reset()
. Now it's common for all environments - I think - therefore there is no need to re-implement it.self.source
state in the init, and this is used byreset()
(in the parent class) to initialise the firstself.state
.self.eos
) in the environments is now an action with the format of other other actions and not an integer or whatever. This is more consistent in my opinion.actions2indices()
that is used by the flowmatch loss.setup()
method that receives the environment as argument and sets whatever variables are necessary, liken_dim
.setup()
is called in the init of the parent env class.utils/buffer.py
max_increment
andmax_dim_per_action
, which specify how many positions (e.g. cells in the grid or discrete angles in the torus) can be done in one action and how many dimensions can be updated in one single action.torus_rounds.py
was obsolete and has been removed.#tests/gflownet/env/common.py
self.get_actions_space()
is nowself.get_action_space()
;get_max_traj_len
is nowget_max_traj_length
;self.d_action_space
is nowself.action_space_dim
.Some things remain to be done:
aptamers.py
) environment has not been cleaned up and updated because I have the more ambitious plan of creating a Sequence parent class from which the aptamers will be inherited.plane.py
) environment has not been cleaned up and updated because it is not working well yet.continuous
, my plan is to mergecontinuous
intomain
(without further review, obviously) and continue improving things from there.