Nerfie paper section 3.5 Coarse-to-Fine Deformation Regularization
(self, inputs, epoch)
| 110 | return W_j |
| 111 | |
| 112 | def embed_DNeRF(self, inputs, epoch): |
| 113 | ''' Nerfie paper section 3.5 Coarse-to-Fine Deformation Regularization ''' |
| 114 | # get weight for each frequency band j |
| 115 | W_j = self.get_embed_weight(epoch, self.N_freqs, self.N) # W_j: [W_0, W_1, W_2, ..., W_{m-1}] |
| 116 | |
| 117 | # Fourier embedding |
| 118 | out = [] |
| 119 | for fn in self.embed_fns: # 17, embed_fns:[input, cos, sin, cos, sin, ..., cos, sin] |
| 120 | out.append(fn(inputs)) |
| 121 | |
| 122 | # apply weighted positional encoding, only to cos&sins |
| 123 | for i in range(len(W_j)): |
| 124 | out[2*i+1] = W_j[i] * out[2*i+1] |
| 125 | out[2*i+2] = W_j[i] * out[2*i+2] |
| 126 | ret = torch.cat(out, -1) |
| 127 | return ret |
| 128 | |
| 129 | def update_N(self, N): |
| 130 | self.N=N |
no test coverage detected