| # Code was taken from https://github.com/wangjuan001/hicplus | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| conv2d1_filters_numbers = 8 | |
| conv2d1_filters_size = 9 | |
| conv2d2_filters_numbers = 8 | |
| conv2d2_filters_size = 1 | |
| conv2d3_filters_numbers = 1 | |
| conv2d3_filters_size = 5 | |
| class Generator(nn.Module): | |
| def __init__(self): | |
| super(Generator, self).__init__() | |
| # 1 input image channel, 6 output channels, 5x5 square convolution | |
| # kernel | |
| self.conv1 = nn.Conv2d(1, conv2d1_filters_numbers, conv2d1_filters_size) | |
| self.conv2 = nn.Conv2d(conv2d1_filters_numbers, conv2d2_filters_numbers, conv2d2_filters_size) | |
| self.conv3 = nn.Conv2d(conv2d2_filters_numbers, 1, conv2d3_filters_size) | |
| def forward(self, x): | |
| #print("start forwardingf") | |
| x = self.conv1(x) | |
| x = F.relu(x) | |
| x = self.conv2(x) | |
| x = F.relu(x) | |
| x = self.conv3(x) | |
| x = F.relu(x) | |
| return x | |