GithubHelp home page GithubHelp logo

Comments (5)

basnijholt avatar basnijholt commented on May 26, 2024

originally posted by Jorn Hoofwijk (@Jorn) at 2018-09-19T14:13:57.207Z on GitLab

After a discussion with @basnijholt, we think that maybe printing a warning.warn(...) may be preferred over an error, and then just to disregard any point that is added outside of the domain.

from adaptive.

basnijholt avatar basnijholt commented on May 26, 2024

originally posted by Jorn Hoofwijk (@Jorn) at 2018-09-20T10:51:01.390Z on GitLab

After another discussion, we came up with the following: Add the point to the self.data dictionary, but do not add it to any other internal state (such as the loss dict etc.)

apart from that, we could decide to give a warning, or not: but only once by the following filter:

warnings.simplefilter('once', MyDeprecationWarning)
for _ in range(100):
    warnings.warn('Warning!', MyDeprecationWarning)

from adaptive.

basnijholt avatar basnijholt commented on May 26, 2024

originally posted by Jorn Hoofwijk (@Jorn) at 2018-09-20T14:17:02.960Z on GitLab

on closer inspection, this would work for the learner1D and the learnerND, the learner2D however, takes into consideration all points that are in self.data:

self.ask() is calculated based on self.losses()

self.losses() is calculated based on self.ip()

self.ip() is calculated based on self.data

therefore if we add the x that is outside the domain into self.data it will be taken into account whenever we request a new point -> so we can't guarantee that self.ask() returns a point inside the domain if we have added points outside the domain to self.data for the learner2D

from adaptive.

basnijholt avatar basnijholt commented on May 26, 2024

originally posted by Jorn Hoofwijk (@Jorn) at 2018-09-20T14:19:54.976Z on GitLab

this doesn't mean the idea is bad, it just means that it would require some extra thought for the Learner2D (probably changing the code of the Learner2D)

from adaptive.

basnijholt avatar basnijholt commented on May 26, 2024

originally posted by Jorn Hoofwijk (@Jorn) at 2018-09-20T14:27:09.221Z on GitLab

in fact: one of the things that should be tested, is the following: (also for the other learners of course)

import adaptive
l = adaptive.Learner1D(lambda x: x, (-1, 1))

l.tell(-1, -1)
l.tell(1, 1)
l.tell(5, 5)

xs, _ = l.ask(1)
x, = xs
assert -1 <= x <= 1

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.