Skip to content

Constrained optimization does not allow duplicate points #436

Closed

Description

@YoungJaeBae

Using bayesian-optimization 1.4.3, in bayesian_optimization.py line 135-155 ,


        if constraint is None:
            # Data structure containing the function to be optimized, the
            # bounds of its domain, and a record of the evaluations we have
            # done so far
            self._space = TargetSpace(f, pbounds, random_state=random_state,
                                      allow_duplicate_points=self._allow_duplicate_points)
            self.is_constrained = False
        else:
            constraint_ = ConstraintModel(
                constraint.fun,
                constraint.lb,
                constraint.ub,
                random_state=random_state
            )
            self._space = TargetSpace(
                f,
                pbounds,
                constraint=constraint_,
                random_state=random_state
            )
            self.is_constrained = True

constrained optimization does not pass argument allow_duplicate_points to initialization of TargetSpace instance, eventually causing errors.

Is this intended behavior?

Activity

  1. t-muser commented on Jul 13, 2023

    @t-muser
    Member

    I don't think this is intended behaviour (@bwheelz36?).

    @YoungJaeBae Would you be willing to provide a fix?

  2. YoungJaeBae commented on Jul 13, 2023

    @YoungJaeBae
    ContributorAuthor

    Thank you for answering.
    I am not familiar with contributing. Would you please do me a favor?

    Best Regards,

  3. t-muser commented on Jul 13, 2023

    @t-muser
    Member

    Not sure I understand your question correctly, but if you're asking how to contribute:

    1. Fork this repository
    2. In your forked version of this repository, fix the problem.
    3. Open a pull request from your repository (where the problem has been fixed) to this repository.
    4. A maintainer of this repository (e.g. me) will review the pull request and merge your contribution.

    See also here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions