Because at the very first iteration, as nn.vW is initialized as zeros, we have norm_vW=0, hence an infinite normalization constant. You could deal with this maybe with an internal variable to specify the first iteration, but I didn't want to add more internal variables