Thanks! I don’t have to implement my own loss function with regularization like following now!

allWeight = Variable(torch.zeros(1)).cuda()
for param in model.parameters():
	if param.dim() == 2:
		allWeight += torch.norm(param.data)