MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / Conv2d

Class Conv2d

modules/parallel_wavegan/layers/upsample.py:47–58  ·  view source on GitHub ↗

Conv2d module with customized initialization.

Source from the content-addressed store, hash-verified

45
46
47class Conv2d(torch.nn.Conv2d):
48 """Conv2d module with customized initialization."""
49
50 def __init__(self, *args, **kwargs):
51 """Initialize Conv2d module."""
52 super(Conv2d, self).__init__(*args, **kwargs)
53
54 def reset_parameters(self):
55 """Reset parameters."""
56 self.weight.data.fill_(1. / np.prod(self.kernel_size))
57 if self.bias is not None:
58 torch.nn.init.constant_(self.bias, 0.0)
59
60
61class UpsampleNetwork(torch.nn.Module):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected