Skip to main content
Ctrl+K

PyBOP Documentation

  • Quick Start
  • Installation
  • Optimisers
  • Contributing
    • API Reference
  • PyPI
  • GitHub
  • Quick Start
  • Installation
  • Optimisers
  • Contributing
  • API Reference
  • PyPI
  • GitHub

Section Navigation

  • pybop
    • pybop._dataset
    • pybop._evaluation
    • pybop._logging
    • pybop._result
    • pybop._utils
    • pybop._version
    • pybop.applications
      • pybop.applications.base_method
      • pybop.applications.gitt_methods
      • pybop.applications.ocp_methods
    • pybop.costs
      • pybop.costs.base_cost
      • pybop.costs.design_cost
      • pybop.costs.error_measures
      • pybop.costs.likelihoods
      • pybop.costs.weighted_cost
    • pybop.models
      • pybop.models._exponential_decay
      • pybop.models.lithium_ion
        • pybop.models.lithium_ion.grouped_spm
        • pybop.models.lithium_ion.grouped_spme
        • pybop.models.lithium_ion.sp_diffusion
        • pybop.models.lithium_ion.weppner_huggins
    • pybop.optimisers
      • pybop.optimisers._adamw
      • pybop.optimisers._cuckoo
      • pybop.optimisers._gradient_descent
      • pybop.optimisers._irprop_plus
      • pybop.optimisers._random_search
      • pybop.optimisers._simulated_annealing
      • pybop.optimisers.base_optimiser
      • pybop.optimisers.base_pints_optimiser
      • pybop.optimisers.pints_optimisers
      • pybop.optimisers.scipy_optimisers
    • pybop.parameters
      • pybop.parameters.parameter
      • pybop.parameters.priors
    • pybop.plot
      • pybop.plot.contour
      • pybop.plot.convergence
      • pybop.plot.dataset
      • pybop.plot.nyquist
      • pybop.plot.parameters
      • pybop.plot.plotly_manager
      • pybop.plot.problem
      • pybop.plot.standard_plots
      • pybop.plot.voronoi
    • pybop.problems
      • pybop.problems.meta_problem
      • pybop.problems.problem
    • pybop.pybamm
      • pybop.pybamm.design_variables
      • pybop.pybamm.eis_simulator
      • pybop.pybamm.parameter_utils
      • pybop.pybamm.simulator
    • pybop.samplers
      • pybop.samplers.base_pints_sampler
      • pybop.samplers.base_sampler
      • pybop.samplers.chain_processor
      • pybop.samplers.mcmc_summary
      • pybop.samplers.pints_samplers
    • pybop.simulators
      • pybop.simulators.base_simulator
  • API Reference
  • pybop
  • pybop.optimisers
  • pybop.optimisers._random_search

pybop.optimisers._random_search#

Classes#

RandomSearchImpl

Random Search (RS) optimisation algorithm.

Module Contents#

class pybop.optimisers._random_search.RandomSearchImpl(x0: numpy.ndarray, sigma0: list[float] | None, boundaries: pints.Boundaries | None)[source]#

Bases: pints.PopulationBasedOptimiser

Random Search (RS) optimisation algorithm. This algorithm explores the parameter space by randomly sampling points.

The algorithm does the following: 1. Initialise a population of solutions. 2. At each iteration, generate n number of random positions within boundaries. 3. Evaluate the quality/fitness of the positions. 4. Replace the best position with improved position if found.

Parameters:
  • population_size – Number of solutions to evaluate per iteration.

  • optional – Number of solutions to evaluate per iteration.

References: The Random Search algorithm implemented in this work is based on principles outlined in “Introduction to Stochastic Search and Optimization: Estimation, Simulation, and Control” by Spall, J. C. (2003).

The implementation inherits from the PINTS PopulationOptimiser.

_suggested_population_size()[source]#

Returns a suggested population size based on the dimension of the parameter space.

ask()[source]#

Returns a list of positions to evaluate in the optimiser-space.

clip_candidates(x)[source]#

Clip the input array to the boundaries if available.

f_best()[source]#

Returns the best score found so far.

name()[source]#

Returns the name of the optimiser.

running()[source]#

Returns True if the optimisation is in progress.

tell(replies)[source]#

Receives a list of cost function values from points previously specified by self.ask(), and updates the optimiser state accordingly.

x_best()[source]#

Returns the best parameter values found so far.

_dim[source]#
_f_best[source]#
_lower = None[source]#
_ready_for_tell = False[source]#
_running = False[source]#
_upper = None[source]#
_x_best[source]#
On this page
  • Classes
  • Module Contents
    • RandomSearchImpl
      • RandomSearchImpl._suggested_population_size()
      • RandomSearchImpl.ask()
      • RandomSearchImpl.clip_candidates()
      • RandomSearchImpl.f_best()
      • RandomSearchImpl.name()
      • RandomSearchImpl.running()
      • RandomSearchImpl.tell()
      • RandomSearchImpl.x_best()
      • RandomSearchImpl._dim
      • RandomSearchImpl._f_best
      • RandomSearchImpl._lower
      • RandomSearchImpl._ready_for_tell
      • RandomSearchImpl._running
      • RandomSearchImpl._upper
      • RandomSearchImpl._x_best

© Copyright 2023, The PyBOP Team.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.