MCPcopy Create free account
hub / github.com/deepbrainai-research/float / __init__

Method __init__

models/float/encoder.py:199–226  ·  view source on GitHub ↗
(self, size, w_dim=512)

Source from the content-addressed store, hash-verified

197
198class EncoderApp(nn.Module):
199 def __init__(self, size, w_dim=512):
200 super(EncoderApp, self).__init__()
201
202 channels = {
203 4: 512,
204 8: 512,
205 16: 512,
206 32: 512,
207 64: 256,
208 128: 128,
209 256: 64,
210 512: 32,
211 1024: 16
212 }
213
214 self.w_dim = w_dim
215 log_size = int(math.log(size, 2))
216
217 self.convs = nn.ModuleList()
218 self.convs.append(ConvLayer(3, channels[size], 1))
219
220 in_channel = channels[size]
221 for i in range(log_size, 2, -1):
222 out_channel = channels[2 ** (i - 1)]
223 self.convs.append(ResBlock(in_channel, out_channel))
224 in_channel = out_channel
225
226 self.convs.append(EqualConv2d(in_channel, self.w_dim, 4, padding=0, bias=False))
227
228 def forward(self, x):
229

Callers

nothing calls this directly

Calls 4

ResBlockClass · 0.85
ConvLayerClass · 0.70
EqualConv2dClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected