正則化

L1 regularization_loss=0 for param in model.parameters(): regularization_loss+=torch.sum(torch.abs(param)) classify_loss+criteon(logits,target) loss=classify_loss+0.01*regularization_loss optimizer.ze
相關文章
相關標籤/搜索