Skip to content

Commit

Permalink
add save_config
Browse files Browse the repository at this point in the history
  • Loading branch information
king-menin committed Jan 19, 2019
1 parent 85b02b0 commit 779d8d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ def __init__(self, model, data, best_model_path, lr=0.001, betas=[0.8, 0.9], cli
self.best_target_metric = 0.
self.lr_scheduler = None

def save_config(self, path):
with open(path, "w") as file:
json.dump(self.config, file)

@classmethod
def from_config(cls, path):
with open(path, "r") as file:
Expand Down

0 comments on commit 779d8d4

Please sign in to comment.