The following code doesn’t actually store a copy of the parameters as they are before the training loop begins, it just stores references to the underlying tensors.
for p in model.parameters():
    theta_0.append(p.data)

You would need to do theta_0.append(p.data.clone()) to store a copy of the parameter data.
Therefore frob_norm_squared will equal zero…
for (p1,p2) in zip(list(model.parameters()), theta_0):
        frob_norm_squared += torch.sum(torch.abs(p1.data - p2) **2)

because p2 is a reference to the same tensor referenced by p1.data
Besides the calculation of frob_norm_squared only uses Tensors, never Variables, therefore it can’t be backpropagated.
So, your regularizer does nothing, and I can only suppose that the ‘normal kmeans loss’ contains some other errors that prevent backpropagation from occurring correctly.