BlackBoxFuncBase¶
- class BlackBoxFuncBase¶
-
Base class for black-box functions.
Methods
Initialize the Variables class.
Evaluates the black-box function with the given input values.
Attributes
Returns the flattened variables dictionary.
Returns the mapping from argument names to variable names or lists of variable names.
Returns the name of the black-box function.
Returns the variables of the black-box function.
- class Variables¶
Bases:
object
A class to hold variables considered in the black-box function.
- __init__( ) None ¶
Initialize the Variables class.
- Parameters:
- Raises:
ValueError – If the flattened_variables_dict is empty.
ValueError – If the mapping is empty.
- __dict__ = mappingproxy({'__module__': 'amplify_bbopt.blackbox', '__doc__': 'A class to hold variables considered in the black-box function.', '__init__': <function BlackBoxFuncBase.Variables.__init__>, '__getattr__': <function BlackBoxFuncBase.Variables.__getattr__>, '__len__': <function BlackBoxFuncBase.Variables.__len__>, '__dict__': <attribute '__dict__' of 'Variables' objects>, '__weakref__': <attribute '__weakref__' of 'Variables' objects>, '__annotations__': {}})¶
- __weakref__¶
list of weak references to the object (if defined)
- abstract __call__(*args: ~typing.~_Param, **kwargs: ~typing.~_Param) float ¶
Call self as a function.
- classmethod __class_getitem__(params)¶
- classmethod __init_subclass__(*args, **kwargs)¶
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- evaluate(values: dict[str, float]) float ¶
Evaluates the black-box function with the given input values.
- __abstractmethods__ = frozenset({'__call__'})¶
- __dict__ = mappingproxy({'__module__': 'amplify_bbopt.blackbox', '__doc__': 'Base class for black-box functions.', 'Variables': <class 'amplify_bbopt.blackbox.BlackBoxFuncBase.Variables'>, '__init__': <function BlackBoxFuncBase.__init__>, 'mapping': <property object>, 'name': <property object>, 'flattened_variables_dict': <property object>, 'variables': <property object>, 'evaluate': <function BlackBoxFuncBase.evaluate>, '__call__': <function BlackBoxFuncBase.__call__>, '__orig_bases__': (<class 'abc.ABC'>, typing.Generic[~_Param]), '__dict__': <attribute '__dict__' of 'BlackBoxFuncBase' objects>, '__weakref__': <attribute '__weakref__' of 'BlackBoxFuncBase' objects>, '__parameters__': (~_Param,), '__abstractmethods__': frozenset({'__call__'}), '_abc_impl': <_abc._abc_data object>, '__annotations__': {'_flattened_variables_dict': 'dict[str, Variable]', '_mapping': 'dict[str, str | list[str]]', '_name': 'str', '_variables': 'BlackBoxFuncBase.Variables | None'}})¶
- __orig_bases__ = (<class 'abc.ABC'>, typing.Generic[~_Param])¶
- __parameters__ = (~_Param,)¶
- __slots__ = ()¶
- __weakref__¶
list of weak references to the object (if defined)