def __init__(self): super().__init__() size = 128 self.project_in = nn.Conv2d(3, size, 3, padding=1) self.unet = DiffusionUNetBackbone2(base=size, factors=[[1, 1, 2], [2, 2, 2], [2, 2, 2]], attention_levels=[], cond_size=4 * size, dropout=0.1, norm=True, middle_attention=False, kernel=cross_low_rank_mvp, attention_block=AttentionBlock) self.out = nn.Conv2d(size, 3, 3, padding=1)
def __init__(self): super().__init__() size = 128 self.project_in = nn.Conv2d(3, size, 3, padding=1) self.unet = DiffusionUNetBackbone2(base=size, factors=[[1, 1, 2], [2, 2, 2], [2, 2, 2]], attention_levels=[1, 2], cond_size=4 * size, dropout=0.1, norm=True, middle_attention=True, kernel=cross_attention, attention_block=AttentionBlock) self.out = nn.Conv2d(size, 3, 3, padding=1) with torch.no_grad(): for param in self.out.parameters(): param.zero_() self.factor = nn.Parameter(torch.zeros(1, requires_grad=True))
def __init__(self): super().__init__() size = 128 self.project_in = nn.Conv2d(3, size, 3, padding=1) self.unet = DiffusionUNetBackbone2( base=size, factors=[ [1, 1, 2], [2, 2, 2], [2, 2, 2] ], attention_levels=[1, 2], cond_size=4 * size, dropout=0.1, norm=True, middle_attention=True, kernel=cross_attention, attention_block=AttentionBlock ) self.out = nn.Conv2d(size, 3, 3, padding=1) self.time = SineEmbedding(512, depth=2) self.Z = nn.Linear(512, 1) self.factor = nn.Linear(512, 1)