hartmann
Hartmann objective function, relying on the botorch implementation.
See: https://botorch.org/api/test_functions.html#botorch.test_functions.synthetic.Hartmann
This code is based on the implementation by Nikita Saxena (nikita-0209) in https://github.com/alexhernandezgarcia/activelearning
The implementation assumes that the inputs will be on [-1, 1]^6 as is typical in the uses of the Hartmann function. The original range is negative and is a minimisation problem. By default, the proxy values remain in this range and the absolute value of the proxy values is used as the reward function.
Attributes
Classes
Module Contents
- hartmann.MODES = [[0.2, 0.2, 0.5, 0.3, 0.3, 0.7], [0.4, 0.9, 0.9, 0.6, 0.1, 0.0], [0.3, 0.1, 0.4, 0.3, 0.3, 0.7],...[source]
- class hartmann.Hartmann(fidelity=1.0, do_domain_map=True, negate=False, reward_function='absolute', **kwargs)[source]
Bases:
gflownet.proxy.base.Proxy- Parameters:
fidelity (float) – Fidelity of the Hartmann oracle. 1.0 corresponds to the original Hartmann. Smaller values (up to 0.0) reduce the fidelity of the oracle.
do_domain_map (bool) – If True, the states are assumed to be in [-1, 1]^6 and are re-mapped to the standard domain in [0, 1]^6 before calling the botorch method. If False, the botorch method is called directly on the states values.
negate (bool) – If True, proxy values are multiplied by -1.
reward_function (str or Callable) – The transformation applied to the proxy outputs to obtain a GFlowNet reward. By default, the reward function is the absolute value of proxy outputs.
- __call__(states)[source]
Implement this function to call the get_reward method of the appropriate Proxy Class (EI, UCB, Proxy, Oracle etc).
- Parameters:
states (ndarray)
- Return type:
torchtyping.TensorType[batch]
- map_to_standard_domain(states)[source]
Maps a batch of input states onto the domain typically used to evaluate the Hartmann function, that is [0, 1]^6. See DOMAIN and LENGTH. It assumes that the inputs are on [-1, 1]^6
- Parameters:
states (torchtyping.TensorType[batch, 6])
- Return type:
torchtyping.TensorType[batch, 6]