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

Method forward

usr/diff/net.py:66–78  ·  view source on GitHub ↗
(self, x, conditioner, diffusion_step)

Source from the content-addressed store, hash-verified

64 self.output_projection = Conv1d(residual_channels, 2 * residual_channels, 1)
65
66 def forward(self, x, conditioner, diffusion_step):
67 diffusion_step = self.diffusion_projection(diffusion_step).unsqueeze(-1)
68 conditioner = self.conditioner_projection(conditioner)
69 y = x + diffusion_step
70
71 y = self.dilated_conv(y) + conditioner
72
73 gate, filter = torch.chunk(y, 2, dim=1)
74 y = torch.sigmoid(gate) * torch.tanh(filter)
75
76 y = self.output_projection(y)
77 residual, skip = torch.chunk(y, 2, dim=1)
78 return (x + residual) / sqrt(2.0), skip
79
80
81class DiffNet(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected