MCPcopy Create free account
hub / github.com/CompVis/diff2flow / forward

Method forward

diff2flow/kl_autoencoder.py:312–337  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

310 padding=1)
311
312 def forward(self, x):
313 # timestep embedding
314 temb = None
315
316 # downsampling
317 hs = [self.conv_in(x)]
318 for i_level in range(self.num_resolutions):
319 for i_block in range(self.num_res_blocks):
320 h = self.down[i_level].block[i_block](hs[-1], temb)
321 if len(self.down[i_level].attn) > 0:
322 h = self.down[i_level].attn[i_block](h)
323 hs.append(h)
324 if i_level != self.num_resolutions-1:
325 hs.append(self.down[i_level].downsample(hs[-1]))
326
327 # middle
328 h = hs[-1]
329 h = self.mid.block_1(h, temb)
330 h = self.mid.attn_1(h)
331 h = self.mid.block_2(h, temb)
332
333 # end
334 h = self.norm_out(h)
335 h = nonlinearity(h)
336 h = self.conv_out(h)
337 return h
338
339
340class Decoder(nn.Module):

Callers

nothing calls this directly

Calls 1

nonlinearityFunction · 0.85

Tested by

no test coverage detected