Skip to content

Simulation eval_coords bug #823

@j-c-c

Description

@j-c-c

When running the notebook in gallery/tutorials/cov3d_simulation.py using a LegacyVolume with C>2 volumes, an error is raised when performing Simulation.eval_coords:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[7], line 22
     17 # Assign the cluster centroids to the different images. Since we expect a discrete distribution of volumes
     18 # (and therefore of coordinates), we assign the centroid coordinate to each image that belongs to that cluster.
     19 # Evaluate the coordinates estimated
     21 clustered_coords_est = centers[vol_idx]
---> 22 coords_perf = sim.eval_coords(mean_est, eigs_est_trunc, clustered_coords_est)

File ~/Work/ASPIRE-python.simulation_default_volume_811/src/aspire/source/simulation.py:438, in Simulation.eval_coords(self, mean_vol, eig_vols, coords_est)
    435 # 0-indexed states vector
    436 states = self.states - 1
--> 438 coords_true = coords_true[states]
    439 res_norms = res_norms[states]
    440 res_inners = res_inners[:, states]

IndexError: index 2 is out of bounds for axis 0 with size 2

In this case, the states indices are being applied to the wrong axis of coords_true. This can be fixed by setting coords_true = coords_true[:, states], but this does not work for C=2 (likely due to the squeeze() used in `Simulation.vol_coords').

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions