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

Steven/feature/gp write choice #188

Merged
merged 8 commits into from
Jun 19, 2020
Merged

Conversation

stevetorr
Copy link
Contributor

@stevetorr stevetorr commented Jun 18, 2020

Minor changes:

  • GaussianProcess.write_model now allows for flexibility for the user to decide if they want the matrices written separately or not.
  • write_model now will not redundantly append .json or .pickle to written models. If the file name is my_model.json then it will not write my_model.json.json. Also, if you don't specify the format, but if you specify it in the string, it automatically detects it. A small friction I've encountered!
  • The remove force data method will now terminate immediately if an empty list is passed in.

@stevetorr stevetorr requested a review from nw13slx June 18, 2020 20:53
@@ -670,20 +673,24 @@ def from_dict(dictionary):
new_gp.n_envs_prev = len(new_gp.training_data)

# Save time by attempting to load in computed attributes
if len(new_gp.training_data) > 5000:
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks for removing this arbitrary criteria

@@ -670,20 +673,24 @@ def from_dict(dictionary):
new_gp.n_envs_prev = len(new_gp.training_data)

# Save time by attempting to load in computed attributes
if len(new_gp.training_data) > 5000:
if dictionary.get('ky_mat_file'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe next time this part can be written as a function? it repeats again in the from_dict method.

@@ -829,21 +855,35 @@ def write_model(self, name: str, format: str = 'json'):
self.alpha = None
self.ky_mat_inv = None

# Automatically detect output format from name variable

for detect in ['json','pickle','binary']:
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is very thoughtful

@stevetorr stevetorr merged commit 4597760 into development Jun 19, 2020
@stevetorr stevetorr deleted the steven/feature/gp_write_choice branch June 19, 2020 16:04
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