Skip to content

Commit

Permalink
mixup
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed Nov 19, 2023
1 parent 6e3983b commit c09c754
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def sis_run_with_prefix(prefix_name: str = None):

_train_exp("base-24gb-v5", config_24gb_v5)
_train_exp("base-24gb-v5-embInit1", config_24gb_v5, config_updates={"embed_init_stddev": 1.0})
_train_exp("base-24gb-v5-mixup", config_24gb_v5, config_updates={"mixup": {}})


_sis_prefix: Optional[str] = None
Expand Down Expand Up @@ -613,6 +614,12 @@ def __init__(

self._pretrain_opts: Optional[Dict[str, Any]] = config.typed_value("pretrain_opts")

self._mixup = None
if config.typed_value("mixup", None) is not None:
from i6_experiments.users.zeyer.returnn.models.rf_mixup import Mixup, MixupOpts

self._mixup = Mixup(feature_dim=self.in_dim, opts=MixupOpts(**config.typed_value("mixup")))

def encode(
self,
source: Tensor,
Expand All @@ -629,6 +636,8 @@ def encode(
sampling_rate=16_000,
log_base=math.exp(2.3026), # almost 10.0 but not exactly...
)
if self._mixup:
source = self._mixup(source, spatial_dim=in_spatial_dim)
# SpecAugment
source = rf.audio.specaugment(
source,
Expand Down

0 comments on commit c09c754

Please sign in to comment.