neural_lam.config#
Configuration dataclasses and helpers for Neural-LAM experiments.
Module Contents#
- exception neural_lam.config.InvalidConfigError#
Bases:
ExceptionRaised when the Neural-LAM configuration file is invalid or malformed.
Initialize self. See help(type(self)) for accurate signature.
- class neural_lam.config.DatastoreSelection#
Configuration for selecting a datastore to use with neural-lam.
- config_path#
The path to the configuration file for the selected datastore, this is assumed to be relative to the configuration file for neural-lam.
- Type:
- class neural_lam.config.ManualStateFeatureWeighting#
Configuration for weighting the state features in the loss function where the weights are manually specified.
- class neural_lam.config.NeuralLAMConfig#
Bases:
dataclass_wizard.JSONWizard,dataclass_wizard.YAMLWizardConfiguration for the Neural-LAM model and training pipeline.
Loads and stores all settings needed to run Neural-LAM, including datastore selection and training hyperparameters. Serialisation and deserialisation from YAML/JSON is handled via
dataclass_wizard.- datastore#
Configuration specifying which datastore backend to use and its associated settings.
- Type:
- training#
Configuration for training the model, including loss function and feature-weighting strategy. Defaults to
TrainingConfig().- Type:
- datastore: DatastoreSelection#
- training: TrainingConfig#
- class neural_lam.config.OutputClamping#
Configuration for clamping the output of the model.
- class neural_lam.config.TrainingConfig#
Configuration related to training neural-lam
- state_feature_weighting#
UnformFeatureWeighting]
The method to use for weighting the state features in the loss function. Defaults to uniform weighting (UnformFeatureWeighting, i.e. all features are weighted equally).
- Type:
Union[ManualStateFeatureWeighting,
- output_clamping: OutputClamping#
- state_feature_weighting: ManualStateFeatureWeighting | UniformFeatureWeighting#
- class neural_lam.config.UniformFeatureWeighting#
Configuration for weighting the state features in the loss function where all state features are weighted equally.
- neural_lam.config.load_config_and_datastore(config_path: str) tuple[NeuralLAMConfig, neural_lam.datastore.MDPDatastore | neural_lam.datastore.NpyFilesDatastoreMEPS]#
Load the neural-lam configuration and the datastore specified in the configuration.
- Parameters:
config_path (str) – Path to the Neural-LAM configuration file.
- Returns:
The Neural-LAM configuration and the loaded datastore.
- Return type:
tuple[NeuralLAMConfig, Union[MDPDatastore, NpyFilesDatastoreMEPS]]