Multiple pipelines - training and evaluation (#250)
- introduce best practice for multiple pipelines - Implement evaluation pipeline - allow for using relative ckpt paths - general refactoring - update README.md
This commit is contained in:
1 parent
02d3b65aaa
commit
fe4e61edc1
25 files changed
+347
-185
No files matched your search
+13
-7
@@ -34,10 +34,11 @@ log = get_logger(__name__)
|
||||
|
||||
|
||||
def extras(config: DictConfig) -> None:
|
||||
"""Optional utilities, controlled by hydra config.
|
||||
"""Applies optional utilities, controlled by config flags.
|
||||
|
||||
Args:
|
||||
config (DictConfig): Configuration composed by Hydra.
|
||||
Utilities:
|
||||
- Ignoring python warnings
|
||||
- Rich config printing
|
||||
"""
|
||||
|
||||
# disable python warnings if <config.ignore_warnings=True>
|
||||
@@ -45,6 +46,11 @@ def extras(config: DictConfig) -> None:
|
||||
log.info("Disabling python warnings! <config.ignore_warnings=True>")
|
||||
warnings.filterwarnings("ignore")
|
||||
|
||||
# pretty print config tree using Rich library if <config.print_config=True>
|
||||
if config.get("print_config"):
|
||||
log.info("Printing config tree with Rich! <config.print_config=True>")
|
||||
print_config(config, resolve=True)
|
||||
|
||||
|
||||
@rank_zero_only
|
||||
def print_config(
|
||||
@@ -91,8 +97,8 @@ def print_config(
|
||||
|
||||
rich.print(tree)
|
||||
|
||||
with open("config_tree.log", "w") as fp:
|
||||
rich.print(tree, file=fp)
|
||||
with open("config_tree.log", "w") as file:
|
||||
rich.print(tree, file=file)
|
||||
|
||||
|
||||
@rank_zero_only
|
||||
@@ -104,10 +110,10 @@ def log_hyperparameters(
|
||||
callbacks: List[pl.Callback],
|
||||
logger: List[pl.loggers.LightningLoggerBase],
|
||||
) -> None:
|
||||
"""Controls which hyperparameters are saved by Lightning loggers.
|
||||
"""Controls which config parts are saved by Lightning loggers.
|
||||
|
||||
Additionaly saves:
|
||||
- number of model parameters
|
||||
- number of model parameters
|
||||
"""
|
||||
|
||||
hparams = {}
|
||||
|
||||
Reference in new issue
Block a user