日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人工智能 > pytorch >内容正文

pytorch

深度学习中常用的误差方法

發布時間:2025/3/21 pytorch 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 深度学习中常用的误差方法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

深度學習中常用的誤差方法有:

  • 標準差(Standard Deviation):

?標準差也叫均方差,是方差的算術平方根,反應數據的離散程度 ,標準差越小,數據偏離平均值越小,反之亦然 。

公式為:

python代碼為:

import math#平均值 def get_average(records):return sum(records) / len(records)#方差 def get_variance(records):average = get_average(records)return sum([(x - average) ** 2 for x in records]) / len(records)#標準差 def get_standard_deviation(records):variance = get_variance(records)return math.sqrt(variance)
  • 均方誤差MSE(mean-square error)

均方誤差 反映估計量與被估計量之間的差異程度。MSE越小,預測結果月精確 。

公式為 :

?

python代碼為:

def get_mse(records_real, records_predict):if len(records_real) == len(records_predict):return sum([(x - y) ** 2 for x, y in zip(records_real, records_predict)]) / len(records_real)else:return None
  • 均方根誤差RMSE(root mean squared error)

均方根誤差為均方誤差的算術平方根。公式為:

python代碼為:

def get_rmse(records_real, records_predict):mse = get_mse(records_real, records_predict)if mse:return math.sqrt(mse)else:return None
  • 平均絕對誤差MAE(mean absolute?error)

python代碼為:

def get_mae(records_real, records_predict):if len(records_real) == len(records_predict):return sum([abs(x - y) for x, y in zip(records_real, records_predict)]) / len(records_real)else:return None

參考資料:

【1】https://blog.csdn.net/cqfdcw/article/details/78173839

【2】https://blog.csdn.net/mouday/article/details/87936476

總結

以上是生活随笔為你收集整理的深度学习中常用的误差方法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。