Max eig of Q limited to 5 times the mean

This commit is contained in:
Daniel Povey 2022-07-09 14:30:03 +08:00
parent ffeef4ede4
commit d139c18f22

View File

@ -604,8 +604,15 @@ param_rms_smooth1: Smoothing proportion for parameter matrix, if assumed rank of
mean = rms.mean()
rms += eps + smooth * mean
new_mean = (eps + (smooth + 1) * mean)
return rms / new_mean
ans = rms / new_mean
# Apply max_rms
max_rms = 5.0
ans.clamp_(max=max_eig*2)
ans /= ans.mean()
ans.clamp_(max=max_eig)
ans /= ans.mean()
return ans