Feature request: find nearest index in a cartesian grid without building the product
Feature request: find nearest index in a cartesian grid without building the product: a task in MiMo-V2.6-RL-harbor-code: MiMo-V2.6-RL Code (Harbor) (Harbor dataset). I'm working with value-function iteration on a multi-dimensional state space built from a few 1-D grids (capital, productivity…
The task
I'm working with value-function iteration on a multi-dimensional state space built from a few 1-D grids (capital, productivity, etc.). The discretized state space is the cartesian product of these per-dimension grids, and I often need to map a continuous point back to the index of its nearest neighbor in that product.
Part of FineEnvs/MiMo-V2.6-RL-harbor-code.