(self, x)
| 129 | ) |
| 130 | |
| 131 | def forward(self, x): |
| 132 | feat = [] |
| 133 | feat_out = [] |
| 134 | for i in range(len(self.encoder)): |
| 135 | # print("layer {} encoder layer: {}".format(i, self.encoder[i])) |
| 136 | x = self.encoder[i](x) |
| 137 | if i == 35: # ReLU-36 |
| 138 | feat.append(x) |
| 139 | elif i == 17: # ReLU-17 |
| 140 | feat.append(x) |
| 141 | elif i == 3: # ReLU-4 |
| 142 | feat.append(x) |
| 143 | for i in range(len(self.decoder)): |
| 144 | # print("layer {} decoder layer: {}".format(i, self.decoder[i])) |
| 145 | x = self.decoder[i](x) |
| 146 | if i == 1: |
| 147 | x = x + feat[2] |
| 148 | feat_out.append(x) |
| 149 | elif i == 3: |
| 150 | x = x + feat[1] |
| 151 | feat_out.append(x) |
| 152 | elif i == 5: |
| 153 | x = x + feat[0] |
| 154 | feat_out.append(x) |
| 155 | return feat_out, x |
| 156 | |
| 157 | class autoencoder_vgg4(nn.Module): # 35.54 PSNR 36.05 BCELoss (120x120) |
| 158 | ''' vgg encoder with bilinear upsampling''' |
nothing calls this directly
no outgoing calls
no test coverage detected