bayesbay.ParameterSpaceState
- class bayesbay.ParameterSpaceState(n_dimensions, param_values=<factory>, cache=<factory>)
Data structure that stores the state of a parameter space.
- Parameters:
n_dimensions (int) – number of dimensions characterizing the parameter space
param_values (Dict[str, Union[np.ndarray, list(ParameterSpaceState)]]) – dictionary containing parameter values, e.g.
{"voronoi": ParameterSpaceState(3, {"voronoi": np.array([1,2,3]), "vs": np.array([4,5,6])}), "rayleigh": DataNoiseState(std=0.01, correlation=None)}
- Raises:
TypeError – when
param_values
is not a dict
Reference Details
- n_dimensions
- param_values
- cache
- copy()
Returns a clone of self
- Return type:
- get_param_values(param_name)
Get the value(s) of a parameter
- Parameters:
param_name (str) – the parameter name (i.e. the key in the
param_values
dict)- Returns:
the value(s) of the given
param_name
, if present inparam_values
- Return type:
Union[np.ndarray, None]
- load_from_cache(name)
Load the cached value for the given
name
- Parameters:
name (str) – the cache name to look up
- Returns:
the cache stored for the given
name
- Return type:
Any
- save_to_cache(name, value)
Store the given value to cache
- Parameters:
name (str) – the cache name to store
value (Any) – the cache value to store
- saved_in_cache(name)
Indicates whether there is cache value stored for the given
name
- Parameters:
name (str) – the cache name to look up
- Returns:
whether there is cache stored for the given
name
- Return type:
bool
- set_param_values(param_name, values)
Changes the numerical value(s) of a parameter
- Parameters:
param_name (str) – the parameter name (i.e. the key in the
param_values
)values (np.ndarray) – the value(s) to be set for the given
param_name
- todict(name)
Returns a dictionary containing the numerical values defining the parameter space
- Parameters:
name (str) – identifier for the
ParameterSpaceState
instance- Returns:
dictionary object with keys
name
.stdname
.correlation (only returned if set as a free parameter, seeTarget
)
- Return type:
dict