Skip to content

Commit

Permalink
[src] Fix default norm_type for causal ConvTasNet (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisCos authored May 18, 2021
1 parent 8a18416 commit e6eefda
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions asteroid/models/conv_tasnet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from asteroid_filterbanks import make_enc_dec
from ..masknn import TDConvNet
from .base_models import BaseEncoderMaskerDecoder
import warnings


class ConvTasNet(BaseEncoderMaskerDecoder):
Expand Down Expand Up @@ -82,6 +83,13 @@ def __init__(
"be the same. Received "
f"{n_feats} and {in_chan}"
)
if causal and norm_type not in ["cgLN", "cLN"]:
norm_type = "cgLN"
warnings.warn(
"In causal configuration cumulative layer normalization (cgLN)"
"or channel-wise Layer Normalization (chanLN) "
f"must be used. Changing f{norm_type} to cgLN"
)
# Update in_chan
masker = TDConvNet(
n_feats,
Expand Down

0 comments on commit e6eefda

Please sign in to comment.