Skip to content

Commit

Permalink
Merge branch 'new-api' of github.com:brandontrabucco/design-bench int…
Browse files Browse the repository at this point in the history
…o new-api
  • Loading branch information
brandontrabucco committed Aug 25, 2021
2 parents 2f9222c + a2dba72 commit b95b554
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions design_bench/datasets/dataset_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,6 @@ def default_exponential_distribution(ranks, c=3.0):
return np.exp(-c * ranks)


def default_circular_distribution(ranks):
"""Accepts the rank of a set of designs as input and returns an
un-normalized linear probability distribution
Arguments:
ranks: np.ndarray
a numpy array representing the rank order of a set of designs given
by their y values in a model-based optimization dataset
Returns:
probabilities: np.ndarray
an un-normalized probability distribution that is passed to
np.random.choice to subsample a model-based optimization dataset
"""

ranks = ranks.astype(np.float32)
ranks = ranks / ranks.max()
return 1.0 - np.sqrt(1.0 - (ranks - 1.0)**2)


class DatasetBuilder(abc.ABC):
"""An abstract base class that defines a common set of functions
and attributes for a model-based optimization dataset, where the
Expand Down

0 comments on commit b95b554

Please sign in to comment.