corners
Corners objective function, defined for box-like environments, such as the hyper-grid and the cube.
The function places high scores in all corners of the hyper-box according to either of these options:
A mixture of Gaussians. Optionally, the scores and can be thresholded in order to make the task harder.
A hard-coded function that assigns each point of the hyper-box to one of three scores (this matches the function used in the original GFlowNets paper):
High scores: points in the corners at a distance from the edge between 0.2 and 0.1 the length of the box.
Middle scores: points in the corners at distance from the edge within a quarter the length of the box.
Low scores: all other points.
Classes
Initializes an instance of the Corners proxy. |
Module Contents
- class corners.Corners(n_dim=None, mu=None, sigma=None, do_gaussians=True, do_threshold=False, thresholds=((0.0, 2.0, 1e-06), (2.0, 3.0, 2.0), (3.0, 100, 10.0)), scores=[2.0, 0.5, 0.01], **kwargs)[source]
Bases:
gflownet.proxy.base.ProxyInitializes an instance of the Corners proxy.
- Parameters:
n_dim (int) – Dimensionality of the hyper-box.
mu (float) – Mean of the Gaussian distributions that make the objective function. It should be a value between 0.0 and 1.0. A value closer to 1.0 places the regions of high scores closer to the edges (in the corners) and a value closer to 0.0 places the regions of high scores closer to the center.
sigma (float) – Standard deviation of the Gaussian distributions that make the objective function.
do_gaussians (bool) – If True, the score landscape is modelled by a mixture of Gaussians. Otherwise, the scores are assigned via an indicator function, as in the original GFlowNets paper.
do_threshold (bool) – If True, the values of the Gaussians are thresholded using the values in
thresholds.thresholds (iterable) – A list of tuples with the information to threshold the objective function. The first two values of the tuple indicate the lower and upper bound of a range, and the third value indicates the value onto which values in the range are mapped. For example, (0.0, 1.0, 1e-6) will map all values between 0.0 and 1.0 to 1e-6.
scores (iterable) – The scores of the three regions for the non-Gaussian version. It should be a list with three elements, where the first element is highest score, the second element the middle score and the third element the lowest score.