loss_grad_std
loss_grad_std(loss, net, device)
Estimate the pooled standard deviation of layer gradients.
Parameters:
-
loss(torch.Tensor of shape ()) –Scalar loss value.
-
net(Module) –Network containing linear layers.
-
device(str or device) –Device used for intermediate tensors.
Returns:
-
std(torch.Tensor of shape ()) –Pooled gradient standard deviation across linear layer parameters.