Skip to main content
Ctrl+K

ODAT-SE API documentation

  • odatse
  • odatse

Section Navigation

  • odatse package
    • odatse.algorithm package
      • odatse.algorithm._algorithm module
      • odatse.algorithm._iterator module
      • odatse.algorithm.bayes module
      • odatse.algorithm.exchange module
      • odatse.algorithm.gather module
      • odatse.algorithm.global_search module
      • odatse.algorithm.mapper_mpi module
      • odatse.algorithm.mapper_mpi_base module
      • odatse.algorithm.min_search module
      • odatse.algorithm.montecarlo module
      • odatse.algorithm.pamc module
      • odatse.algorithm.random_search module
      • odatse.algorithm.state module
      • odatse.algorithm.ttopt module
    • odatse.domain package
      • odatse.domain._domain module
      • odatse.domain.meshgrid module
      • odatse.domain.region module
    • odatse.scripts package
      • odatse.scripts.extract_combined module
      • odatse.scripts.plt_1D_histogram module
      • odatse.scripts.plt_2D_histogram module
      • odatse.scripts.plt_model_evidence module
      • odatse.scripts.separateT module
      • odatse.scripts.summarize_each_T module
    • odatse.solver package
      • odatse.solver._solver module
      • odatse.solver.analytical module
      • odatse.solver.function module
    • odatse.util package
      • odatse.util.data_writer module
      • odatse.util.graph module
      • odatse.util.limitation module
      • odatse.util.logger module
      • odatse.util.mapping module
      • odatse.util.neighborlist module
      • odatse.util.read_matrix module
      • odatse.util.read_ts module
      • odatse.util.resampling module
      • odatse.util.separateT module
      • odatse.util.toml module
      • odatse.util.version module
    • odatse.__main__ module
    • odatse._info module
    • odatse._initialize module
    • odatse._main module
    • odatse._runner module
    • odatse._version module
    • odatse.exception module
    • odatse.mpi module
  • odatse
  • odatse package
  • odatse.algorithm package
  • odatse.algorithm.random_search module

odatse.algorithm.random_search module#

class odatse.algorithm.random_search.Algorithm(info: Info, runner: Runner | None = None, run_mode: str = 'initial')[source]#

Bases: Algorithm

Algorithm class that evaluates the objective function at random points. Inherits from odatse.algorithm.mapper_mpi_base.Algorithm.

Initialize the Algorithm instance.

Parameters:
  • info (Info) – Information object containing algorithm parameters.

  • runner (Runner) – Optional runner object for submitting tasks.

  • run_mode (str) – Mode to run the algorithm, defaults to “initial”.

__init__(info: Info, runner: Runner | None = None, run_mode: str = 'initial') → None[source]#

Initialize the Algorithm instance.

Parameters:
  • info (Info) – Information object containing algorithm parameters.

  • runner (Runner) – Optional runner object for submitting tasks.

  • run_mode (str) – Mode to run the algorithm, defaults to “initial”.

_apply_state(data: dict, mode: str = 'resume', restore_rng: bool = True) → None[source]#

Restore algorithm state; in continue mode also extend the run.

For mode="continue" the point set is extended to the num_points of the new input: the previously evaluated points are kept (restored from the checkpoint) and only the additional points are evaluated. This is supported for the “random” mode and for the sobol/halton quasi-random sequences, whose point sets are nested (the first N points of a longer sequence are exactly the N points of the shorter one). It is rejected for latin, whose design is not nested.

_check_continue(data: dict) → None[source]#

Validate that the new input is a legal extension of the old run.

_extend_points(data: dict) → None[source]#

Extend the iterator with the additional points (continue mode).

_quasi_random_iterator(info_param, seq, seed=None)[source]#

Setup a quasi-random (low-discrepancy) point sequence.

Parameters:
  • info_param – Dictionary containing parameters for setting up the points.

  • seq (str) – Sequence type: “sobol”, “halton”, or “latin”.

  • seed (int, optional) – Seed for the scrambling of the sequence. The sequence is generated on the algorithm-rank-0 process only, so a single integer makes the whole point set reproducible independently of the MPI configuration. If None, the scrambling differs from run to run.

_random_iterator(info_param, rng)[source]#

Setup the grid based on min, max, and num lists.

Parameters:

info_param – Dictionary containing parameters for setting up the grid.

previous

odatse.algorithm.pamc module

next

odatse.algorithm.state module

On this page
  • Algorithm
    • Algorithm.__init__()
    • Algorithm._apply_state()
    • Algorithm._check_continue()
    • Algorithm._extend_points()
    • Algorithm._quasi_random_iterator()
    • Algorithm._random_iterator()
Show Source

© Copyright 2020-, ISSP, UTokyo.

Created using Sphinx 9.0.4.

Built with the PyData Sphinx Theme 0.21.0.