Created
May 3, 2020 06:48
-
-
Save MattSegal/fea30d10d26ef666f3a572e97f03c339 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from cerberus import Validator | |
ENV_CHOICES = ("aws", "desktop", "laptop") | |
CONFIG_SCHEMA = { | |
"runtime": { | |
"type": "dict", | |
"schema": {"cuda": {"type": "boolean", "required": True, "nullable": False},}, | |
}, | |
"logging": { | |
"type": "dict", | |
"schema": { | |
"wandb": { | |
"type": "dict", | |
"schema": { | |
"run_name": {"type": "string", "required": True, "nullable": True}, | |
"project_name": { | |
"type": "string", | |
"required": True, | |
"nullable": True, | |
}, | |
}, | |
}, | |
"checkpoint": { | |
"type": "dict", | |
"schema": { | |
"save_name": {"type": "string", "required": True, "nullable": True}, | |
"save_epochs": { | |
"type": "integer", | |
"required": True, | |
"nullable": True, | |
}, | |
}, | |
}, | |
}, | |
}, | |
"training": { | |
"type": "dict", | |
"schema": { | |
"epochs": {"type": "integer", "required": True, "nullable": False}, | |
"batch_size": {"type": "integer", "required": True, "nullable": False}, | |
"subsample": {"type": "integer", "required": True, "nullable": True}, | |
}, | |
}, | |
} | |
validator = Validator(CONFIG_SCHEMA) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment