#!/usr/bin/env python
+# Any copyright is dedicated to the Public Domain.
+# https://creativecommons.org/publicdomain/zero/1.0/
+
+# Written by Francois Fleuret <francois@fleuret.org>
+
# ImageMagick's montage to make the mosaic
#
# montage hallu-*.png -tile 5x6 -geometry +1+1 result.png
class MultiScaleEdgeEnergy(torch.nn.Module):
def __init__(self):
- super(MultiScaleEdgeEnergy, self).__init__()
+ super().__init__()
k = torch.exp(- torch.tensor([[-2., -1., 0., 1., 2.]])**2 / 2)
k = (k.t() @ k).view(1, 1, 5, 5)
self.gaussian_5x5 = torch.nn.Parameter(k / k.sum()).requires_grad_(False)