{"$schema": "http://json-schema.org/draft-07/schema#", "definitions": {"GeneralSchema": {"properties": {"key": {"title": "key", "type": "string", "description": "A unique key used to retrieve in registry. For example, given `Lamb` for optimizers, it will check `OptimRegistry` and find the optimizer `apex.optim.FusedLAMB`."}, "params": {"title": "params", "type": "object", "description": "Corresponding funcation call parameters. So the whole call is `registry.get(key)(**params)`.", "additionalProperties": {}}}, "type": "object", "required": ["key", "params"], "additionalProperties": false}, "TrainSchema": {"properties": {"batchSize": {"title": "batchSize", "type": "integer", "description": "Batch size for training. NOTE: The actual batch size (whole world) is computed by `batchSize * gpus`.", "exclusiveMinimum": 0}, "epoch": {"title": "epoch", "type": "integer", "description": "Total training epochs.", "exclusiveMinimum": 0}, "externalLib": {"title": "externalLib", "type": "array", "description": "External libraries used for training. All python files in `externalLib` will be imported as modules. In this way, you could extend registries.", "items": {"title": "externalLib", "type": "string"}}, "gpu": {"type": "object", "$ref": "#/definitions/GPUSchema", "description": "GPU configs for training."}, "hooks": {"title": "hooks", "type": "array", "description": "Hooks used for training. Key is used to retrieve hook from `mcquic.train.hooks`.", "items": {"type": "object", "$ref": "#/definitions/GeneralSchema"}}, "optim": {"type": "object", "$ref": "#/definitions/GeneralSchema", "description": "Optimizer used for training. As for current we have `Adam` and `Lamb`."}, "saveDir": {"title": "saveDir", "type": "string", "description": "A dir path to save model checkpoints, TensorBoard messages and logs."}, "schdr": {"type": "object", "$ref": "#/definitions/GeneralSchema", "description": "Learning rate scheduler used for training. As for current we have `ReduceLROnPlateau`, `Exponential`, `MultiStep`, `OneCycle` and all schedulers defined in `mcquic.train.lrSchedulers`."}, "target": {"title": "target", "type": "string", "description": "Training target. Now is one of `[PSNR, MsSSIM]`.", "enum": ["PSNR", "MsSSIM"]}, "trainSet": {"title": "trainSet", "type": "string", "description": "A dir path to load `lmdb` dataset. You need to convert your images before you give this path by calling `mcquic dataset ...`."}, "valFreq": {"title": "valFreq", "type": "integer", "description": "Run validation after every `valFreq` epochs.", "exclusiveMinimum": 0}, "valSet": {"title": "valSet", "type": "string", "description": "A dir path to load image files for validation."}}, "type": "object", "required": ["batchSize", "epoch", "gpu", "optim", "saveDir", "schdr", "target", "trainSet", "valFreq", "valSet"], "additionalProperties": false}, "GPUSchema": {"properties": {"gpus": {"title": "gpus", "type": "integer", "description": "Number of gpus for training. This affects the `world size` of PyTorch DDP.", "exclusiveMinimum": 0}, "vRam": {"title": "vRam", "type": "integer", "description": "Minimum VRam required for each gpu. Set it to `-1` to use all gpus."}, "wantsMore": {"title": "wantsMore", "type": "boolean", "description": "Set to `true` to use all visible gpus and all VRams and ignore `gpus` and `vRam`."}}, "type": "object", "required": ["gpus", "vRam", "wantsMore"], "additionalProperties": false}, "ConfigSchema": {"properties": {"model": {"type": "object", "$ref": "#/definitions/GeneralSchema", "description": "Compression model to use. Now we only have one model, so `key` is ignored. Avaliable params are `channel`, `m` and `k`."}, "train": {"type": "object", "$ref": "#/definitions/TrainSchema", "description": "Training configs."}}, "type": "object", "required": ["model", "train"], "additionalProperties": false}}, "$ref": "#/definitions/ConfigSchema"}