MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / __init__

Method __init__

Code/net/Generator.py:14–22  ·  view source on GitHub ↗
(self,in_channels,out_channels,down=True,use_act=True,**kwargs)

Source from the content-addressed store, hash-verified

12
13class ConvBlock(torch.nn.Module):
14 def __init__(self,in_channels,out_channels,down=True,use_act=True,**kwargs):
15 super(ConvBlock, self).__init__()
16 self.conv = torch.nn.Sequential(
17 torch.nn.Conv2d(in_channels=in_channels,out_channels=out_channels,padding_mode='reflect',**kwargs)
18 if down
19 else torch.nn.ConvTranspose2d(in_channels=in_channels,out_channels=out_channels,**kwargs),
20 torch.nn.BatchNorm2d(num_features=out_channels),
21 torch.nn.ReLU(inplace=True) if use_act else torch.nn.Identity()
22 )
23 def forward(self,x):
24 return self.conv(x)
25

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected