mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Revert optim schedule
This commit is contained in:
parent
299482d02d
commit
cdfa388ac0
@ -875,16 +875,7 @@ class LearnedDownsamplingModule(nn.Module):
|
|||||||
if random.random() < 0.01 or __name__ == '__main__':
|
if random.random() < 0.01 or __name__ == '__main__':
|
||||||
logging.info(f"mean weight={weights.mean()}, mean-abs-scores={scores.abs().mean()} positive-scores={(scores>0).to(torch.float32).mean()}, discarded-weights={weights_discarded.mean()}, seq_len={seq_len}, seq_len_reduced={seq_len_reduced}")
|
logging.info(f"mean weight={weights.mean()}, mean-abs-scores={scores.abs().mean()} positive-scores={(scores>0).to(torch.float32).mean()}, discarded-weights={weights_discarded.mean()}, seq_len={seq_len}, seq_len_reduced={seq_len_reduced}")
|
||||||
|
|
||||||
|
weights_discarded = weights_discarded.flip(dims=1)
|
||||||
|
|
||||||
# randomly rotate `weights_discarded` on the sequence axis; this is
|
|
||||||
# intended to ensure that it doesn't assign the highest scores to
|
|
||||||
# not-so-important elements to avoid the randomness of these
|
|
||||||
# discarded weights.
|
|
||||||
r = random.randint(0, seq_len_reduced - 1)
|
|
||||||
weights_discarded = torch.cat((weights_discarded[:, r:],
|
|
||||||
weights_discarded[:, :r]),
|
|
||||||
dim=1)
|
|
||||||
|
|
||||||
weights = (weights[:, :seq_len_reduced] - weights_discarded)
|
weights = (weights[:, :seq_len_reduced] - weights_discarded)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -882,7 +882,7 @@ class Eden(LRScheduler):
|
|||||||
warmup_factor = (
|
warmup_factor = (
|
||||||
1.0
|
1.0
|
||||||
if self.batch >= self.warmup_batches
|
if self.batch >= self.warmup_batches
|
||||||
else 0.1 + 0.9 * (self.batch / self.warmup_batches)
|
else 0.5 + 0.5 * (self.batch / self.warmup_batches)
|
||||||
)
|
)
|
||||||
|
|
||||||
return [x * factor * warmup_factor for x in self.base_lrs]
|
return [x * factor * warmup_factor for x in self.base_lrs]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user