-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactoring parameter class #133
base: main
Are you sure you want to change the base?
Conversation
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.
Looks very good! There are a few things for you to have a look at
@@ -21,131 +24,170 @@ class Parameters(dict): | |||
|
|||
Parameters |
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.
Makes sense to name this "Attributes" now rather than "Parameters"
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 would have thought it's the "parameters of the experiment" (in which case "attributes" makes less sense)
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.
It's about the docstring standard which we're following. These are more properly attributes of the class, rather than parameters. It's not a big deal though
assert self.num_iterations == 1 | ||
|
||
def update_from_dict(self, dictionary: dict, *, skip_keys: list = ()): | ||
raise NotImplementedError |
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.
Dataclasses are mutable, so you can just implement this...
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.
Thanks for this! There are a few comments still to have a look at. In particular, the implementation of run replaying is quite important, since we really do use it :)
# refresh_every ∈ {-1} ∪ {1,2,3,...} | ||
assert isinstance(self.refresh_every, int) | ||
assert self.refresh_every == -1 or self.refresh_every >= 1 | ||
|
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.
Nice!
@@ -21,131 +24,170 @@ class Parameters(dict): | |||
|
|||
Parameters |
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.
It's about the docstring standard which we're following. These are more properly attributes of the class, rather than parameters. It's not a big deal though
No description provided.