Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dvae.py and change param gamma to weight #733

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ChatTTS/model/dvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
) # pointwise/1x1 convs, implemented with linear layers
self.act = nn.GELU()
self.pwconv2 = nn.Linear(intermediate_dim, dim)
self.gamma = (
self.weight = (
nn.Parameter(layer_scale_init_value * torch.ones(dim), requires_grad=True)
if layer_scale_init_value > 0
else None
Expand All @@ -55,8 +55,8 @@ def forward(self, x: torch.Tensor, cond=None) -> torch.Tensor:
del y
y = self.pwconv2(x)
del x
if self.gamma is not None:
y *= self.gamma
if self.weight is not None:
y *= self.weight
y.transpose_(1, 2) # (B, T, C) -> (B, C, T)

x = y + residual
Expand Down
Loading