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

Refactor predictor loading and saving #81

Merged
merged 3 commits into from
May 14, 2024
Merged

Refactor predictor loading and saving #81

merged 3 commits into from
May 14, 2024

Conversation

danyoungday
Copy link
Collaborator

Refactored predictor loading and saving to be more intuitive using classmethods to load them all in 1 go.

@danyoungday danyoungday self-assigned this Apr 30, 2024
@ofrancon ofrancon changed the base branch from main to documentation May 11, 2024 00:17
@ofrancon ofrancon self-requested a review May 11, 2024 00:17
Copy link
Member

@ofrancon ofrancon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@abstractmethod
def load(self, path: str):
def load(cls, path: str):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the load method return? I expect a Predictor class on which I can call the abstract predict method.

def load(cls, path: str) -> Predictor:

self.set_params(features, label, hidden_sizes, linear_skip,
dropout, device, epochs, batch_size, optim_params,
train_pct, step_lr_params)
def __init__(self, model_config: dict):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A docstring explaining what the config dict should contain would be useful here.

Base automatically changed from documentation to main May 14, 2024 17:45
@danyoungday danyoungday merged commit 29234c8 into main May 14, 2024
1 check passed
@danyoungday danyoungday deleted the refactor_nnp branch May 14, 2024 17:58
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