Skip to content

Grid search produces IndexError: pop from empty list #21

Description

@sgbaird
Algorithm: Grid [repetition 1]
[INFO] Loading emulator using a BayesNeuralNet model for the dataset photo_pce10...
[INFO] Last parameter being provided - there will not be any more available samples in the grid.
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
[<ipython-input-7-f36bc3f1915d>](https://localhost:8080/#) in <module>
     36         campaign=Campaign(),  # store results in a new campaign,
     37         database=database,    # but use the same database to store campaign;
---> 38         num_iter=64,         # run benchmark for num_iter iterations
     39     )
     40     elapsed_time = time() - start_time

4 frames
[/usr/local/lib/python3.7/dist-packages/olympus/olympus.py](https://localhost:8080/#) in run(self, planner, dataset, model, goal, campaign, database, num_iter)
     55             planner=planner_, emulator=emulator, campaign=campaign, database=database,
     56         )
---> 57         self.evaluator.optimize(num_iter=num_iter)
     58 
     59     def run_analytic(

[/usr/local/lib/python3.7/dist-packages/olympus/evaluators/evaluator.py](https://localhost:8080/#) in optimize(self, num_iter)
     66             # NOTE: now we get 1 param at a time, a possible future expansion is
     67             #       to return batches
---> 68             params = self.planner.recommend(observations=self.campaign.observations)
     69 
     70             # get measurement from emulator/surface

[/usr/local/lib/python3.7/dist-packages/olympus/planners/abstract_planner.py](https://localhost:8080/#) in recommend(self, observations, return_as)
    130         """
    131         self.tell(observations)
--> 132         return self.ask(return_as=return_as)
    133 
    134     def optimize(self, emulator, num_iter=1, verbose=False):

[/usr/local/lib/python3.7/dist-packages/olympus/planners/abstract_planner.py](https://localhost:8080/#) in ask(self, return_as)
     95 
     96         self.num_generated += 1
---> 97         param_vector = self._ask()
     98 
     99         # check that the parameters suggested are within the bounds of our param_space

[/usr/local/lib/python3.7/dist-packages/olympus/planners/planner_grid/wrapper_grid.py](https://localhost:8080/#) in _ask(self)
    126         if self.grid_created is False:
    127             self._create_grid()
--> 128         param = self.samples.pop(0)
    129 
    130         if len(self.samples) == 0:

IndexError: pop from empty list

Reproducer Colab Notebook

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions