Created
April 20, 2020 07:25
-
-
Save DalyaG/e2a3df5c43e28913dddcd8a29151de94 to your computer and use it in GitHub Desktop.
log input params
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
# Here we assume: params = MyParamsClass() | |
sorted_params_dict = {k: params.__dict__[k] for k | |
in sorted(params.__dict__.keys())} | |
params_filepath = os.path.join(log_dir, 'params.json') | |
json.dump(sorted_params_dict, open(params_filepath, 'w'), indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment