mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 10:02:22 +00:00
Add more stats.
This commit is contained in:
parent
21ebd356e7
commit
b2abcd721a
@ -135,16 +135,18 @@ def get_diagnostics_for_dim(dim: int, tensors: List[Tensor],
|
|||||||
ans = [ '%.2g' % x for x in ans ]
|
ans = [ '%.2g' % x for x in ans ]
|
||||||
ans = '[' + ' '.join(ans) + ']'
|
ans = '[' + ' '.join(ans) + ']'
|
||||||
if stats_type == "value":
|
if stats_type == "value":
|
||||||
norm = (stats ** 2).sum().sqrt().item()
|
|
||||||
mean_abs = stats.abs().mean().item()
|
|
||||||
# This norm is useful because it is strictly less than the largest
|
# This norm is useful because it is strictly less than the largest
|
||||||
# sqrt(eigenvalue) of the variance, which we print out, and shows,
|
# sqrt(eigenvalue) of the variance, which we print out, and shows,
|
||||||
# speaking in an approximate way, how much of that largest eigenvalue
|
# speaking in an approximate way, how much of that largest eigenvalue
|
||||||
# can be attributed to the mean of the distribution.
|
# can be attributed to the mean of the distribution.
|
||||||
ans += f', norm={norm:.2g}, mean_abs={mean_abs:.2g}'
|
norm = (stats ** 2).sum().sqrt().item()
|
||||||
|
mean = stats.mean().item()
|
||||||
|
rms = (stats ** 2).mean().sqrt().item()
|
||||||
|
ans += f', norm={norm:.2g}, mean={mean:.2g}, rms={rms:.2g}'
|
||||||
else:
|
else:
|
||||||
mean = stats.mean().item()
|
mean = stats.mean().item()
|
||||||
ans += f', mean={mean:.2g}'
|
rms = (stats ** 2).mean().sqrt().item()
|
||||||
|
ans += f', mean={mean:.2g}, rms={rms:.2g}'
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user