feijoa.plugins package#
Submodules#
feijoa.plugins.plugin module#
Base plugin’s class module.
- class feijoa.plugins.plugin.Plugin(subscribers=None)#
Bases:
feijoa.utils.mixins.Observer,feijoa.utils.mixins.SubjectBase plugin’s class.
The idea of plugins is to optionally add new functionality to search oracles. The plugin inherits from the Subject and Observer classes. This means that he can be both a subject (receive notification from oracle), as well as an observer (send alerts to oracle).
- Parameters
subscribers (list) – Initial array of subscribers.
- Raises
AnyError – If anything bad happens.
- property aliases#
- property anchor#
- attach(observer)#
Attach an observer to the subject.
- Parameters
observer (feijoa.utils.mixins.Observer) –
- Return type
None
- detach(observer)#
Detach an observer from the subject.
- Parameters
observer (feijoa.utils.mixins.Observer) –
- Return type
None
- notify(event, *args, **kwargs)#
Notify all observers about an event.
- Return type
None
- abstract update(event, subject, *args, **kwargs)#
Receive update from subject.
- Args:
- event:
Type of event.
- subject:
Subject of notification.
- Returns:
None
- Raises:
AnyError: If anything bad happens.
feijoa.plugins.reducer module#
Reducer class module.
- class feijoa.plugins.reducer.DomainReducer(gamma_osc=0.7, gamma_pan=1.2, eta=0.9, min_window_value=0.0, subscribers=None)#
Bases:
feijoa.plugins.plugin.PluginA sequential domain reduction transformer bassed on the work by Stander, N. and Craig, K: “On the robustness of a simple domain reduction scheme for simulation‐based optimization”
Link: http://www.truegrid.com/srsm_revised.pdf
Based on: https://github.com/fmfn/BayesianOptimization
- Parameters
gamma_osc (float) – Shrinkage parameter for oscillation. Typically, [0.5-0.7].
gamma_pan (float) – Panning parameter. Typically, 1.0.
eta (float) – Zoom parameter.
min_window_value (float) –
- Raises
AnyError – If anything bad happens.
- aliases = ('domain_reducer',)#
- anchor = 'reducer'#
- attach(observer)#
Attach an observer to the subject.
- Parameters
observer (feijoa.utils.mixins.Observer) –
- Return type
None
- detach(observer)#
Detach an observer from the subject.
- Parameters
observer (feijoa.utils.mixins.Observer) –
- Return type
None
- init(space)#
Init reducer.
- Parameters
space (SearchSpace) – Search space instance.
- Raises
AnyError – If anything bad happens.
- notify(event, *args, **kwargs)#
Notify all observers about an event.
- Return type
None
- refit(x_opt)#
- Parameters
x_opt (numpy.ndarray) –
- update(event, subject, *args, **kwargs)#
Update reducer as subscriber to oracle.