From 613ce1be1aac84c729bb1e77b029df260644cc1c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 19 Mar 2019 15:50:15 +0200 Subject: [PATCH] updates --- utils/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 12cd7342..1e5e691f 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -37,10 +37,10 @@ def model_info(model): # Plots a line-by-line description of a PyTorch model n_p = sum(x.numel() for x in model.parameters()) # number parameters n_g = sum(x.numel() for x in model.parameters() if x.requires_grad) # number gradients - print('\n%5s %35s %9s %12s %20s %12s %12s' % ('layer', 'name', 'gradient', 'parameters', 'shape', 'mu', 'sigma')) + print('\n%5s %38s %9s %12s %20s %12s %12s' % ('layer', 'name', 'gradient', 'parameters', 'shape', 'mu', 'sigma')) for i, (name, p) in enumerate(model.named_parameters()): name = name.replace('module_list.', '') - print('%5g %35s %9s %12g %20s %12.3g %12.3g' % ( + print('%5g %38s %9s %12g %20s %12.3g %12.3g' % ( i, name, p.requires_grad, p.numel(), list(p.shape), p.mean(), p.std())) print('Model Summary: %g layers, %g parameters, %g gradients' % (i + 1, n_p, n_g))