Skip to content
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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

CJ-Griffin
Copy link
Contributor

No description provided.

Copy link
Member

@SamAdamDay SamAdamDay left a 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

al_llm/parameters.py Outdated Show resolved Hide resolved
al_llm/parameters.py Outdated Show resolved Hide resolved
@@ -21,131 +24,170 @@ class Parameters(dict):

Parameters
Copy link
Member

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"

Copy link
Contributor Author

@CJ-Griffin CJ-Griffin Mar 10, 2023

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)

Copy link
Member

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

al_llm/parameters.py Outdated Show resolved Hide resolved
al_llm/parameters.py Show resolved Hide resolved
al_llm/classifier.py Show resolved Hide resolved
al_llm/experiment.py Show resolved Hide resolved
al_llm/parameters.py Show resolved Hide resolved
assert self.num_iterations == 1

def update_from_dict(self, dictionary: dict, *, skip_keys: list = ()):
raise NotImplementedError
Copy link
Member

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...

tests/test_experiment.py Show resolved Hide resolved
Copy link
Member

@SamAdamDay SamAdamDay left a 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

Copy link
Member

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants