MCPcopy
hub / github.com/descriptinc/descript-audio-codec / __init__

Method __init__

dac/model/dac.py:116–141  ·  view source on GitHub ↗
(
        self,
        input_channel,
        channels,
        rates,
        d_out: int = 1,
    )

Source from the content-addressed store, hash-verified

114
115class Decoder(nn.Module):
116 def __init__(
117 self,
118 input_channel,
119 channels,
120 rates,
121 d_out: int = 1,
122 ):
123 super().__init__()
124
125 # Add first conv layer
126 layers = [WNConv1d(input_channel, channels, kernel_size=7, padding=3)]
127
128 # Add upsampling + MRF blocks
129 for i, stride in enumerate(rates):
130 input_dim = channels // 2**i
131 output_dim = channels // 2 ** (i + 1)
132 layers += [DecoderBlock(input_dim, output_dim, stride)]
133
134 # Add final conv layer
135 layers += [
136 Snake1d(output_dim),
137 WNConv1d(output_dim, d_out, kernel_size=7, padding=3),
138 nn.Tanh(),
139 ]
140
141 self.model = nn.Sequential(*layers)
142
143 def forward(self, x):
144 return self.model(x)

Callers

nothing calls this directly

Calls 4

WNConv1dFunction · 0.90
Snake1dClass · 0.90
DecoderBlockClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected