mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-19 05:54:20 +00:00
Remove some debugging code, found the mismatch
This commit is contained in:
parent
ba96439c76
commit
8efc512823
@ -956,21 +956,10 @@ param_rms_smooth1: Smoothing proportion for parameter matrix, if assumed rank of
|
|||||||
if simple_update:
|
if simple_update:
|
||||||
# normalize the scales in a way that preserves the Frobenius norm of the
|
# normalize the scales in a way that preserves the Frobenius norm of the
|
||||||
# projected parameter deltas
|
# projected parameter deltas
|
||||||
P_rms = this_P_proj.clone()
|
P_rms = this_P_proj / _mean(this_P_proj, exclude_dims=[0], keepdim=True)
|
||||||
P_rms = P_rms / _mean(P_rms, exclude_dims=[0], keepdim=True)
|
|
||||||
P_rms_compare = this_P_proj.clone()
|
|
||||||
P_rms_compare /= _mean(P_rms_compare, exclude_dims=[0], keepdim=True)
|
|
||||||
|
|
||||||
mean_diff = (P_rms - P_rms_compare)
|
|
||||||
if True:
|
|
||||||
ratio = mean_diff.abs().sum() / P_rms.abs().sum()
|
|
||||||
logging.info(f"ratio for division is {ratio}, shapes are {P_rms.shape}, {P_rms_compare.shape}")
|
|
||||||
if ratio > 1.0e-10:
|
|
||||||
logging.warn(f"P_rms={P_rms}, P_rms_compare={P_rms_compare}")
|
|
||||||
scale = P_rms.unsqueeze(-1).sqrt()
|
scale = P_rms.unsqueeze(-1).sqrt()
|
||||||
Q *= scale
|
Q *= scale
|
||||||
logging.info(f"Q rms = {(Q**2).mean().sqrt()}, abs-rms = {Q.abs().mean()}")
|
logging.info(f"Q rms = {(Q**2).mean().sqrt()} abs-rms = {Q.abs().mean()}")
|
||||||
|
|
||||||
# no iterative stuff, just use sqrt(P_proj) as scale on Q. If this is False, we need to
|
# no iterative stuff, just use sqrt(P_proj) as scale on Q. If this is False, we need to
|
||||||
# call self._update_param_scales(...) from the calling function.
|
# call self._update_param_scales(...) from the calling function.
|
||||||
if True:
|
if True:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user