vak.config.model.ModelConfig¶
- class vak.config.model.ModelConfig(name: str, network: dict, optimizer: dict, loss: dict, metrics: dict)[source]¶
Bases:
objectClass representing the model table of a toml configuration file.
- network¶
Keyword arguments for the network class, or a
dictof ``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
ModelConfiginstance to adictthat can be passed into functions that take amodel_configargument, likevak.train()andvak.predict().from_config_dict(config_dict)Return
ModelConfiginstance from adict.Attributes
- asdict()[source]¶
Convert this
ModelConfiginstance to adictthat can be passed into functions that take amodel_configargument, likevak.train()andvak.predict().
- classmethod from_config_dict(config_dict: dict)[source]¶
Return
ModelConfiginstance from adict.The
dictpassed 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’])