vak.config.model.ModelConfig¶
- class vak.config.model.ModelConfig(name: str, network: dict, optimizer: dict, loss: dict, metrics: dict)[source]¶
Bases:
object
Class representing the model table of a toml configuration file.
- network¶
Keyword arguments for the network class, or a
dict
of ``dict``s mapping network names to keyword arguments.- Type:
- __init__(name: str, network: dict, optimizer: dict, loss: dict, metrics: dict) None ¶
Method generated by attrs for class ModelConfig.
Methods
__init__
(name, network, optimizer, loss, metrics)Method generated by attrs for class ModelConfig.
asdict
()Convert this
ModelConfig
instance to adict
that can be passed into functions that take amodel_config
argument, likevak.train()
andvak.predict()
.from_config_dict
(config_dict)Return
ModelConfig
instance from adict
.Attributes
- asdict()[source]¶
Convert this
ModelConfig
instance to adict
that can be passed into functions that take amodel_config
argument, likevak.train()
andvak.predict()
.
- classmethod from_config_dict(config_dict: dict)[source]¶
Return
ModelConfig
instance from adict
.The
dict
passed in should be the one found by loading a valid configuration toml file withvak.config.parse.from_toml_path()
, and then using a top-level table key, followed by key'model'
. E.g.,config_dict['train']['model']` or ``config_dict['predict']['model']
.Examples
config_dict = vak.config.parse.from_toml_path(toml_path) model_config = vak.config.Model.from_config_dict(config_dict[‘train’])