profit.config
Module Contents
Classes
General class with methods which are useful for all Config classes. |
|
This class and its modular subclasses provide all possible configuration parameters. |
|
Run configuration with the following sub classes: |
|
Configuration for the surrogate and encoder. Currently, the only sub config is for the GaussianProcess classes. |
|
Active learning configuration. |
|
General class with methods which are useful for all Config classes. |
|
General class with methods which are useful for all Config classes. |
|
General class with methods which are useful for all Config classes. |
|
Acquisition function configuration. |
|
Acquisition function configuration. |
|
Acquisition function configuration. |
|
Acquisition function configuration. |
|
Acquisition function configuration. |
|
Acquisition function configuration. |
|
Acquisition function configuration. |
|
Acquisition function configuration. |
|
Configuration for the Graphical User Interface. |
|
Default config for all run sub configs which just updates the attributes with user entries. |
Functions
|
|
|
|
|
Load the configuration parameters from a python file into dict. |
Attributes
yaml has to be configured to represent OrderedDict |
|
- profit.config.VALID_FORMATS = ('.yaml', '.py')
yaml has to be configured to represent OrderedDict see https://stackoverflow.com/questions/16782112/can-pyyaml-dump-dict-items-in-non-alphabetical-order and https://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts
- profit.config._mapping_tag
- profit.config.load_config_from_py(filename)[source]
Load the configuration parameters from a python file into dict.
- class profit.config.AbstractConfig(**entries)[source]
Bases:
profit.util.base_class.CustomABC
General class with methods which are useful for all Config classes.
- labels
- defaults
- update(**entries)[source]
Updates the attributes with user inputs. A warning is issued if the attribute set by the user is unknown.
- Parameters:
entries (dict) – User input of the config parameters.
- process_entries(base_config)[source]
After the attributes are set, they are formatted and edited to standardize the user inputs.
- Parameters:
base_config (BaseConfig) – In sub configs, the data from the base config is needed.
- set_defaults(default_dict)[source]
Default values are set from a default dictionary, which is usually located in the global profit.defaults file.
- create_subconfig(sub_config_label, **entries)[source]
Instances of sub configs are created from a string or a dictionary.
- Parameters:
sub_config_label (str) – Dict key of registered sub config.
entries (dict) – User input parameters.
- __getitem__(item)[source]
Implements the dictionary like get method with brackets.
- Parameters:
item (str) – Label of the attribute to return.
- Returns:
Attribute or if the attribute is a sub config, a dictionary of the sub config items.
- class profit.config.BaseConfig(base_dir=defaults.base_dir, **entries)[source]
Bases:
AbstractConfig
This class and its modular subclasses provide all possible configuration parameters.
- Parts of the Config:
base_dir
run_dir
config_file
include
ntrain
variables
- files
input
output
- run
runner
interface
pre
post
- fit
surrogate
save / load
fixed_sigma_n
active_learning
ui
Base configuration for fundamental parameters.
- Parameters:
base_dir (str) – Base directory.
run_dir (str) – Run directory.
config_path (str) – Path to configuration file.
include (list) – Paths to custom files which are loaded in the beginning.
files (dict) – Paths for input and output files.
ntrain (int) – Number of training samples.
variables (dict) – All variables.
input (dict) – Input variables.
output (dict) – Output variables.
independent (dict) – Independent variables, if the result of the simulation is a vector.
- labels
- class profit.config.RunConfig(**entries)[source]
Bases:
AbstractConfig
- Run configuration with the following sub classes:
- runner
local
slurm
- interface
memmap
zeromq
- pre
template
- post
json
numpytxt
hdf5
A default sub class which just updates the entries from a user input is also implemented and used if the class from the user input is not found.
Custom config classes can also be registered, e.g. as a custom runner:
@RunnerConfig.register("custom") class CustomRunner(LocalRunnerConfig): def process_entries(self, base_config): # do something else than the usual LocalRunnerConfig pass
Default values from the global profit.defaults.py file are loaded.
- labels
- defaults = 'run'
- class profit.config.FitConfig(**entries)[source]
Bases:
AbstractConfig
Configuration for the surrogate and encoder. Currently, the only sub config is for the GaussianProcess classes.
- labels
- defaults = 'fit'
- class profit.config.ALConfig(**entries)[source]
Bases:
AbstractConfig
Active learning configuration.
- labels
- defaults = 'active_learning'
- process_entries(base_config)[source]
After the attributes are set, they are formatted and edited to standardize the user inputs.
- Parameters:
base_config (BaseConfig) – In sub configs, the data from the base config is needed.
- class profit.config.AlgorithmALConfig(**entries)[source]
Bases:
AbstractConfig
General class with methods which are useful for all Config classes.
- labels
- defaults
- class profit.config.SimpleALConfig(**entries)[source]
Bases:
AlgorithmALConfig
General class with methods which are useful for all Config classes.
- labels
- defaults = 'al_algorithm_simple'
- process_entries(base_config)[source]
After the attributes are set, they are formatted and edited to standardize the user inputs.
- Parameters:
base_config (BaseConfig) – In sub configs, the data from the base config is needed.
- class profit.config.McmcConfig(**entries)[source]
Bases:
AlgorithmALConfig
General class with methods which are useful for all Config classes.
- labels
- defaults = 'al_algorithm_mcmc'
- process_entries(base_config)[source]
After the attributes are set, they are formatted and edited to standardize the user inputs.
- Parameters:
base_config (BaseConfig) – In sub configs, the data from the base config is needed.
- class profit.config.AcquisitionFunctionConfig(**entries)[source]
Bases:
AbstractConfig
Acquisition function configuration.
- labels
- defaults
- process_entries(base_config)[source]
After the attributes are set, they are formatted and edited to standardize the user inputs.
- Parameters:
base_config (BaseConfig) – In sub configs, the data from the base config is needed.
- class profit.config.SimpleExplorationConfig(**entries)[source]
Bases:
AcquisitionFunctionConfig
Acquisition function configuration.
- labels
- defaults = 'al_acquisition_function_simple_exploration'
- class profit.config.ExplorationWithDistancePenaltyConfig(**entries)[source]
Bases:
AcquisitionFunctionConfig
Acquisition function configuration.
- labels
- defaults = 'al_acquisition_function_exploration_with_distance_penalty'
- class profit.config.WeightedExplorationConfig(**entries)[source]
Bases:
AcquisitionFunctionConfig
Acquisition function configuration.
- labels
- defaults = 'al_acquisition_function_weighted_exploration'
- class profit.config.ProbabilityOfImprovementConfig(**entries)[source]
Bases:
AcquisitionFunctionConfig
Acquisition function configuration.
- labels
- defaults = 'al_acquisition_function_probability_of_improvement'
- class profit.config.ExpectedImprovementConfig(**entries)[source]
Bases:
AcquisitionFunctionConfig
Acquisition function configuration.
- labels
- defaults = 'al_acquisition_function_expected_improvement'
- class profit.config.ExpectedImprovement2Config(**entries)[source]
Bases:
AcquisitionFunctionConfig
Acquisition function configuration.
- labels
- defaults = 'al_acquisition_function_expected_improvement_2'
- class profit.config.AlternatingExplorationConfig(**entries)[source]
Bases:
AcquisitionFunctionConfig
Acquisition function configuration.
- labels
- defaults = 'al_acquisition_function_alternating_exploration'
- class profit.config.UIConfig(**entries)[source]
Bases:
AbstractConfig
Configuration for the Graphical User Interface.
- labels
- defaults = 'ui'
- class profit.config.DefaultConfig(**entries)[source]
Bases:
AbstractConfig
Default config for all run sub configs which just updates the attributes with user entries.
- labels
- defaults