GithubHelp home page GithubHelp logo

Comments (3)

basnijholt avatar basnijholt commented on May 26, 2024

originally posted by Jorn Hoofwijk (@Jorn) at 2018-09-17T18:26:22.524Z on GitLab

I think it is indeed best practice to just raise an exception, as we should not allow this to happen.

If for some reason I cannot think of, we would need to silently ignore it we could set some variable strict mode (which defaults to True) in the init call, and then if we encounter a double point we will throw an error, unless strict mode is set to False, then we silently ignore

so you would then create a learner by:

learner = LearnerND(func, bounds=[(-1,1),(-1,1)]) # for normal behaviour)
learner = LearnerND(func, bounds=[(-1,1),(-1,1)], strict=False) # for allowing a user to add the same point twice, for whatever reason they would want this

from adaptive.

basnijholt avatar basnijholt commented on May 26, 2024

originally posted by Anton Akhmerov (@anton-akhmerov) at 2018-09-24T19:22:39.053Z on GitLab

ignore or overwrite?

from adaptive.

basnijholt avatar basnijholt commented on May 26, 2024

originally posted by Bas Nijholt (@basnijholt) at 2018-12-07T19:44:56.320Z on GitLab

We have decided that we should do the following:

def tell(self, x, y):
    if x in self.data:
        # The point is already evaluated before
        return
    
    # Add point to the data dict
    self.data[x] = y

    # remove from set of pending points
    self.pending_points.discard(x)

    if not self.bounds[0] <= x <= self.bounds[1]:
        # if outside of the domain, stop.
        return

    update_the_other_data_structure_such_as_loss(...)

This is implemented in all the learners ATM.

from adaptive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.