MCPcopy Index your code
hub / github.com/ActiveVisionLab/DFNet / embed_DNeRF

Method embed_DNeRF

script/models/nerfw.py:145–160  ·  view source on GitHub ↗

Nerfie paper section 3.5 Coarse-to-Fine Deformation Regularization

(self, inputs, epoch)

Source from the content-addressed store, hash-verified

143 return W_j
144
145 def embed_DNeRF(self, inputs, epoch):
146 ''' Nerfie paper section 3.5 Coarse-to-Fine Deformation Regularization '''
147 # get weight for each frequency band j
148 W_j = self.get_embed_weight(epoch, self.N_freqs, self.N) # W_j: [W_0, W_1, W_2, ..., W_{m-1}]
149
150 # Fourier embedding
151 out = []
152 for fn in self.embed_fns: # 17, embed_fns:[input, cos, sin, cos, sin, ..., cos, sin]
153 out.append(fn(inputs))
154
155 # apply weighted positional encoding, only to cos&sins
156 for i in range(len(W_j)):
157 out[2*i+1] = W_j[i] * out[2*i+1]
158 out[2*i+2] = W_j[i] * out[2*i+2]
159 ret = torch.cat(out, -1)
160 return ret
161
162 def update_N(self, N):
163 self.N=N

Callers 1

get_embedderFunction · 0.45

Calls 1

get_embed_weightMethod · 0.95

Tested by

no test coverage detected