in touch_charts/models.py [0:0]
def __init__(self, args, dim = 100):
super(Encoder, self).__init__()
self.args = args
# settings
n_channels = 3
n_classes = 1
# downscale the image
self.inc = DoubleConv(n_channels, 64)
self.down1 = Down(64, 128)
self.down2 = Down(128, 256)
self.down3 = Down(256, 512)
# upscale the image
self.down4 = Down(512, 1024)
self.up1 = Up(1024, 512)
self.up2 = Up(512, 256)
self.up3 = Up(256, 128)
self.up4 = Up(128, 64)
self.outc = OutConv(64, n_classes)
# define a plane of the same size, and shape at the touch sensor
width = .0218 - 0.00539
y_z = torch.arange(dim).cuda().view(dim, 1).expand(dim, dim).float()
y_z = torch.stack((y_z, y_z.permute(1, 0))).permute(1, 2, 0)
plane = torch.cat((torch.zeros(dim, dim, 1).cuda(), y_z), dim=-1)
self.orig_plane = (plane / float(dim) - .5) * width