(self, input)
| 79 | |
| 80 | # extract relu1_1, relu2_1, relu3_1, relu4_1 from input image |
| 81 | def encode_with_intermediate(self, input): |
| 82 | results = [input] |
| 83 | for i in range(4): |
| 84 | func = getattr(self, 'enc_{:d}'.format(i + 1)) |
| 85 | results.append(func(results[-1])) |
| 86 | return results[1:] |
| 87 | |
| 88 | def calc_mean_std(self, feat, eps=1e-5): |
| 89 | # eps is a small value added to the variance to avoid divide-by-zero. |