我目前正在使用吡伦制造LM Ann
#gradient
g = np.dot(J.transpose(),e)
#calculate scaled inverse hessian
try:
G = np.linalg.inv(JJ+dampfac*np.eye(net['N']))
#scaled inverse hessian except np.linalg.LinAlgError:
# Not invertible. Go small step in gradient direction
w_delta = 1.0/1e10 * g
else:
# calculate weight modification
w_delta = np.dot(-G,g)
但有时会收到此警告
/usr/local/lib/python3.6/dist-packages/pyrenn.py:722: RuntimeWarning: invalid value encountered in multiply G = np.linalg.inv(JJ+dampfac*np.eye(net['N'])) #scaled inverse hessian .
有人可以解决这个问题吗? 每当我碰到这个问题时,程序就会卡住。