MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS-TTS / Decoder

Class Decoder

moss_soundeffect_v2/diffsynth/models/dac_vae.py:772–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770
771
772class Decoder(nn.Module):
773 def __init__(
774 self,
775 input_channel,
776 channels,
777 rates,
778 d_out: int = 1,
779 ):
780 super().__init__()
781
782 # Add first conv layer
783 layers = [WNConv1d(input_channel, channels, kernel_size=7, padding=3)]
784
785 # Add upsampling + MRF blocks
786 for i, stride in enumerate(rates):
787 input_dim = channels // 2**i
788 output_dim = channels // 2 ** (i + 1)
789 layers += [DecoderBlock(input_dim, output_dim, stride)]
790
791 # Add final conv layer
792 layers += [
793 Snake1d(output_dim),
794 WNConv1d(output_dim, d_out, kernel_size=7, padding=3),
795 nn.Tanh(),
796 ]
797
798 self.model = nn.Sequential(*layers)
799
800 def forward(self, x):
801 return self.model(x)
802
803
804class DAC(BaseModel, CodecMixin):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected