From 031e35b0b8792a10df9acdce9f0f00e25a006f53 Mon Sep 17 00:00:00 2001 From: David Rotermund <54365609+davrot@users.noreply.github.com> Date: Thu, 20 Jul 2023 01:51:27 +0200 Subject: [PATCH] Add files via upload --- inspect_weights_conv_0.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inspect_weights_conv_0.py b/inspect_weights_conv_0.py index 0d917d3..0c64c8d 100644 --- a/inspect_weights_conv_0.py +++ b/inspect_weights_conv_0.py @@ -23,7 +23,9 @@ assert layer_id < len(model) weights = model[layer_id]._parameters["weight"].data bias = model[layer_id]._parameters["bias"].data -weight_grid = tv.utils.make_grid(weights, nrow=8, padding=2, scale_each=scale_each) +weight_grid = tv.utils.make_grid( + weights, nrow=8, padding=2, scale_each=scale_each, pad_value=float("NaN") +) v_max_abs = torch.abs(weight_grid[0, ...]).max()