# coding=utf-8 #共轭梯度算法求最小值 import numpy as np from scipy import optimize def f(x, *args): u, v = x a, b, c, d, e, f,g,h = args return a*u**g+ b*u*v + c*v**h + d*u + e*v + f def gradf(x, *args): u, v = x a, b, c, d, e, f,g,h = args gu = g*a*u + b*v +
补充在前:实际上在我使用LSTM为流量基线建模时候,发现有效的激活函数是elu.relu.linear.prelu.leaky_relu.softplus,对应的梯度算法是adam.mom.rmsprop.sgd,效果最好的组合是:prelu+rmsprop.我的代码如下: # Simple example using recurrent neural network to predict time series values from __future__ import division, p