Skip to content

Commit

Permalink
updated texts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dibyendu-IITKGP committed Dec 5, 2024
2 parents 2d5c7d2 + 3dc64bf commit 54bf352
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pybop/optimisers/_random_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class RandomSearchImpl(PopulationBasedOptimiser):
2. At each iteration, generate new random solutions within boundaries.
3. Evaluate the quality/fitness of the solutions.
4. Update the best solution found so far.
Parameters:
- population_size (optional): Number of solutions to evaluate per iteration.
Expand All @@ -30,6 +30,7 @@ def __init__(self, x0, sigma0=0.05, boundaries=None, population_size=None):

super().__init__(x0, sigma0, boundaries=boundaries)


# Population size, defaulting to a suggested value
self._population_size = population_size or self._suggested_population_size()
self.step_size = self._sigma0
Expand Down Expand Up @@ -70,6 +71,7 @@ def tell(self, replies):
if not self._ready_for_tell:
raise RuntimeError("Optimiser not ready for tell()")


self._iterations += 1
self._ready_for_tell = False

Expand Down
2 changes: 1 addition & 1 deletion pybop/optimisers/pints_optimisers.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ def __init__(
**optimiser_kwargs,
)


class RandomSearch(BasePintsOptimiser):
"""
Adapter for the Random Search optimiser in PyBOP.
Expand Down Expand Up @@ -736,7 +737,6 @@ def __init__(
parallel: bool = False,
**optimiser_kwargs,
):

super().__init__(
cost,
RandomSearchImpl,
Expand Down

0 comments on commit 54bf352

Please sign in to comment.