首页 > 编程知识 正文

随机梯度法,随机梯度下降SGD算法实现

时间:2023-05-06 02:44:22 阅读:170606 作者:4024

importnumpyasnpimportmathimportrandomx=NP.random.choice (NP.array ([ 2104,1600,2400,1416,3000 ],5 ) x1=5 540]、5 ) a=0.0000100 error=0.00001 dert=random.random (der t1=random.random ) dert2=random.random ) sit=rand 5 ) :错误(derterrordert 1错误2错误) 3360错误=(sits it2 * x [ I ] sit3* x1 [ I ]-t [ I ] ) 1错误t1=) ) sit=sit-dert * as it2=sit2- der print (der t1 ) print (der T2 ) print (sit2) sit3) x3=3600 x4=5h=sits it2

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。