def __init__(self, oc, use_bn=False): super().__init__() self.conv1x1 = conv(oc, oc, 1) if use_bn: self.bblock = nn.Sequential(conv(oc, oc, 3), nn.BatchNorm2d(oc), relu(), conv(oc, oc, 3, bias=False)) else: self.bblock = nn.Sequential(conv(oc, oc, 3), relu(), conv(oc, oc, 3, bias=False)) # Basic block
def __init__(self, in_channels=64): super().__init__() self.conv1 = conv(in_channels, in_channels // 2, 3) self.up1 = PyrUpBicubic2d(in_channels) self.conv2 = conv(in_channels // 2, 1, 3) self.up2 = PyrUpBicubic2d(in_channels // 2)
def __init__(self, fc, ic, oc): super().__init__() nc = ic + oc self.reduce = nn.Sequential(conv(fc, oc, 1), relu(), conv(oc, oc, 1)) self.transform = nn.Sequential(conv(nc, nc, 3), relu(), conv(nc, nc, 3), relu(), conv(nc, oc, 3), relu())
def __init__(self, in_channels=1024, c_channels=96, out_channels=1, init_iters=(5, 10, 10, 10, 10), update_iters=(10, ), update_filters=True, filter_reg=(1e-4, 1e-2), precond=(1e-4, 1e-2), precond_lr=0.1, CG_forgetting_rate=75, memory_size=80, train_skipping=8, learning_rate=0.1, pixel_weighting=None, device=None, layer=None): super().__init__() self.project = conv(in_channels, c_channels, 1, bias=False) self.filter = conv(c_channels, out_channels, 3, bias=False) self.layer = layer self.init_iters = init_iters self.update_iters = update_iters self.filter_reg = filter_reg self.precond = precond self.direction_forget_factor = (1 - precond_lr)**CG_forgetting_rate self.train_skipping = train_skipping self.learning_rate = learning_rate self.memory_size = memory_size self.pw_params = pixel_weighting self.device = device self.update_filters = update_filters self.to(device) self.frame_num = 0 self.update_optimizer = None self.current_sample = None self.memory = None
def __init__(self, in_channels=64): super().__init__() self.conv1 = conv(in_channels, in_channels // 2, 3) self.conv2 = conv(in_channels // 2, 1, 3)
def __init__(self, oc, deepest): super().__init__() self.convreluconv = nn.Sequential(conv(2 * oc, oc, 1), relu(), conv(oc, oc, 1)) self.deepest = deepest