Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

utils.py 392 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
  1. import yaml
  2. from argparse import Namespace
  3. def read_hparams(path: str) -> Namespace:
  4. """
  5. Use to read some hyperparameters which were previously saved as YAML.
  6. This is the format used by DAGsHubLogger, and the returned Namespace is compatible with pytorch-lightning models.
  7. """
  8. with open(path) as f:
  9. params = yaml.safe_load(f)
  10. return Namespace(**params)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...