MCPcopy Create free account
hub / github.com/MYZY-AI/Muyan-TTS / __init__

Method __init__

sovits/models.py:139–162  ·  view source on GitHub ↗
(
        self, in_channels, filter_channels, kernel_size, p_dropout, gin_channels=0
    )

Source from the content-addressed store, hash-verified

137
138class DurationPredictor(nn.Module):
139 def __init__(
140 self, in_channels, filter_channels, kernel_size, p_dropout, gin_channels=0
141 ):
142 super().__init__()
143
144 self.in_channels = in_channels
145 self.filter_channels = filter_channels
146 self.kernel_size = kernel_size
147 self.p_dropout = p_dropout
148 self.gin_channels = gin_channels
149
150 self.drop = nn.Dropout(p_dropout)
151 self.conv_1 = nn.Conv1d(
152 in_channels, filter_channels, kernel_size, padding=kernel_size // 2
153 )
154 self.norm_1 = modules.LayerNorm(filter_channels)
155 self.conv_2 = nn.Conv1d(
156 filter_channels, filter_channels, kernel_size, padding=kernel_size // 2
157 )
158 self.norm_2 = modules.LayerNorm(filter_channels)
159 self.proj = nn.Conv1d(filter_channels, 1, 1)
160
161 if gin_channels != 0:
162 self.cond = nn.Conv1d(gin_channels, in_channels, 1)
163
164 def forward(self, x, x_mask, g=None):
165 x = torch.detach(x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected