autonomousvision / giraffe

This repository contains the code for the CVPR 2021 paper "GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields"
https://m-niemeyer.github.io/project-pages/giraffe/index.html
MIT License
1.23k stars 160 forks source link

[code] details about code #16

Closed Feynman1999 closed 3 years ago

Feynman1999 commented 3 years ago

in giraffe/models/decoder.py, line 131, why need unsqueeze opr? the shape of net is (batch,hidden), and the output of self.fc_z(z_shape) is (batch, hidden) too.

Feynman1999 commented 3 years ago

I seem to understand. Is apperance and shape the same in a batch?

Feynman1999 commented 3 years ago

Under normal circumstances, the dims of param 'z_shape' is 1, not 2 like (batch ,hidden)?

m-niemeyer commented 3 years ago

HI, the dimension of p is "B N 3", so that the dimension of "net" is "B N Hidden". The dimension of the z_shape you mentioned has dimension "B Hidden", so that we perform an unsqueeze on the point-dimension N (all points of the same object get the same shape code).