第四章 第四节 神经网络(参数展开(Unrolling Parameters))

matlab 中还原:

Theta1 = reshape(thetaVec(1:110),10,11)
Theta2 = reshape(thetaVec(111:220),10,11)
Theta3 = reshape(thetaVec(221:231),1,11)

python 中还原:

import numpy as np
# ...
Theta1 = thetaVec[0:110].reshape(10,11)
Theta2 = thetaVec[110:220].reshape(10,11)
Theta3 = thetaVec[220:231].reshape(1,11)

猜你喜欢

转载自blog.csdn.net/LW_GHY/article/details/86715724