sarafridov / K-Planes

Other
479 stars 45 forks source link

question about the implementation of the 2D grid #9

Closed liwenssss closed 1 year ago

liwenssss commented 1 year ago

hello, thanks for your nice work. When read your code, I have a question about your implementation of 2D grid. In your code, you use pytorch to create the grid volume. And I notice you use the tcnn module to build some MLPs. I notice that the tcnn module has implement multi-resolution hash grid, so what the different between them ?

sarafridov commented 1 year ago

Although I'm not an expert in the tcnn hash grid implementation, here's my understanding of the difference. My understanding is that tcnn's multi-resolution hash grid is encoding a full 3D grid via hashing; each 3D grid cell maps randomly to an entry in a hash table, and multiple 3D grid cells are allowed to "collide" and hash to the same entry. Our multiresolution grids are in 2D rather than 3D, and they are stored as regular tensors without any hashing, so each 2D grid cell gets its own memory (no collisions). We combine the 2D grids into 3D by interpolation and multiplication. Both methods are doing some compression compared to storing a 3D grid directly, but the compression schemes are different.

liwenssss commented 1 year ago

Thanks for your explanation!!