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

Class Block

diff2flow/tiny_autoencoder.py:19–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18
19class Block(nn.Module):
20 def __init__(self, n_in, n_out):
21 super().__init__()
22 self.conv = nn.Sequential(conv(n_in, n_out), nn.ReLU(), conv(n_out, n_out), nn.ReLU(), conv(n_out, n_out))
23 self.skip = nn.Conv2d(n_in, n_out, 1, bias=False) if n_in != n_out else nn.Identity()
24 self.fuse = nn.ReLU()
25 def forward(self, x):
26 return self.fuse(self.conv(x) + self.skip(x))
27
28
29def Encoder(latent_channels=4):

Callers 2

EncoderFunction · 0.85
DecoderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected