in src/hyperconv.py [0:0]
def __init__(self, ch_in, ch_out, z_dim, kernel_size, dilation=1):
'''
:param ch_in: (int) input channels
:param ch_out: (int) output channels
:param z_dim: (int) dimension of the weight-generating input
:param kernel_size: (int) size of the filter
:param dilation: (int) dilation
'''
super().__init__()
self.kernel_size = kernel_size
self.dilation = dilation
self.ch_in = ch_in
self.ch_out = ch_out
self.conv = HyperConv(z_dim, ch_in, ch_out, kernel_size, dilation)
self.residual = nn.Conv1d(ch_out, ch_out, kernel_size=1)
self.residual.weight.data.uniform_(-np.sqrt(6.0/ch_out), np.sqrt(6.0/ch_out))
self.skip = nn.Conv1d(ch_out, ch_out, kernel_size=1)
self.skip.weight.data.uniform_(-np.sqrt(6.0/ch_out), np.sqrt(6.0/ch_out))
if not ch_in == ch_out:
self.equalize_channels = nn.Conv1d(ch_in, ch_out, kernel_size=1)
self.equalize_channels.weight.data.uniform_(-np.sqrt(6.0 / ch_in), np.sqrt(6.0 / ch_in))