(self,
block_expansion,
in_features,
num_blocks=3,
max_features=256,
mobile_net=False)
| 357 | Hourglass Decoder |
| 358 | """ |
| 359 | def __init__(self, |
| 360 | block_expansion, |
| 361 | in_features, |
| 362 | num_blocks=3, |
| 363 | max_features=256, |
| 364 | mobile_net=False): |
| 365 | super(Decoder, self).__init__() |
| 366 | |
| 367 | up_blocks = [] |
| 368 | |
| 369 | for i in range(num_blocks)[::-1]: |
| 370 | out_filters = min(max_features, block_expansion * (2**i)) |
| 371 | if mobile_net: |
| 372 | in_filters = (1 if i == num_blocks - 1 else 2) * min( |
| 373 | max_features, block_expansion * (2**(i + 1))) |
| 374 | up_blocks.append( |
| 375 | MobileUpBlock2d(in_filters, |
| 376 | out_filters, |
| 377 | kernel_size=3, |
| 378 | padding=1)) |
| 379 | else: |
| 380 | in_filters = (1 if i == num_blocks - 1 else 2) * min( |
| 381 | max_features, block_expansion * (2**(i + 1))) |
| 382 | up_blocks.append( |
| 383 | UpBlock2d(in_filters, out_filters, kernel_size=3, |
| 384 | padding=1)) |
| 385 | |
| 386 | self.up_blocks = nn.LayerList(up_blocks) |
| 387 | self.out_filters = block_expansion + in_features |
| 388 | |
| 389 | def forward(self, x): |
| 390 | out = x.pop() |
nothing calls this directly
no test coverage detected