📜  pytorch 计算 mse mae - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:00.720000             🧑  作者: Mango

代码示例1
error = torch.abs(preds - targets).sum().data
squared_error = ((preds - targets)*(preds - targets)).sum().data
runnning_mae += error
runnning_mse += squared_error