Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • adaptive adaptive
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 36
    • Issues 36
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Quantum TinkererQuantum Tinkerer
  • adaptiveadaptive
  • Merge requests
  • !94

add runner.max_retries

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Bas Nijholt requested to merge runner_retries into master Sep 09, 2018
  • Overview 14
  • Commits 2
  • Pipelines 20
  • Changes 2

This PR (mainly) introduces runner.max_retries and runner.raise_if_max_retries.

With this the following function would be "learned":

import adaptive
adaptive.notebook_extension()

def f(x, offset=0):
    from random import random
    a = 0.01
    if random() < 0.9:
        raise Exception('Oops, this failed.')
    return x + a**2 / (a**2 + (x - offset)**2)

learner = adaptive.Learner1D(f, bounds=(-1, 1))
runner = adaptive.BlockingRunner(learner, goal=lambda l: l.loss() < 0.05,
                         max_retries=20, log=True, raise_if_max_retries=False)

I also introduce BlockingRunner.overhead and the corresponding timing functions and put the shared code of BlockingRunner and AsyncRunner in BaseLearner methods.

Edited Sep 09, 2018 by Bas Nijholt
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: runner_retries