GANs/Pix2Pix_Isola_et_al_2017/model.py
def forward(self, x, z):
        """Generate a translation of x conditioned on the noise z."""
        x = torch.cat((x, z), dim=1)
        skip = [None]*len(self.encoder)

        for idx, block in zip(range(len(skip)-1, -1, -1), self.encoder):
            x = block(x)
            skip[idx] = x

        for idx, block in enumerate(self.decoder):
            if idx > 0:
                x = torch.cat((x, skip[idx]), dim=1)
            x = block(x)

        return x
Generate a translation of x conditioned on the noise z.
Generate a translation of x conditioned on the noise z.
Generate a translation of x conditioned on the noise z .
def forward(self, x, z):
        x = torch.cat((x, z), dim=1)
        skip = [None]*len(self.encoder)
        for idx, block in zip(range(len(skip)-1, -1, -1), self.encoder):
            x = block(x)
            skip[idx] = x
        for idx, block in enumerate(self.decoder):
            if idx > 0:
                x = torch.cat((x, skip[idx]), dim=1)
            x = block(x)
        return x
def forward ( self , x , z ) : x = torch . cat ( ( x , z ) , dim = 1 ) skip = [ None ] * len ( self . encoder ) for idx , block in zip ( range ( len ( skip ) - 1 , - 1 , - 1 ) , self . encoder ) : x = block ( x ) skip [ idx ] = x for idx , block in enumerate ( self . decoder ) : if idx > 0 : x = torch . cat ( ( x , skip [ idx ] ) , dim = 1 ) x = block ( x ) return x
Generate a translation of x conditioned on the noise z.
Generate a translation of x conditioned on the noise z .
"""Generate a translation of x conditioned on the noise z."""
self
x
z