本文整理匯總了Python中NN.makeStandardNeuralNet方法的典型用法代碼示例。如果您正苦於以下問題:Python NN.makeStandardNeuralNet方法的具體用法?Python NN.makeStandardNeuralNet怎麽用?Python NN.makeStandardNeuralNet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NN
的用法示例。
在下文中一共展示了NN.makeStandardNeuralNet方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: range
# 需要導入模塊: import NN [as 別名]
# 或者: from NN import makeStandardNeuralNet [as 別名]
#interneuron
NN.Matrix([5,1],[5,1],sigmaR=sigmaR),
NN.Addition([5,1],sigmaR=sigmaR),
NN.ComponentwiseFunction(),
# interneuron 2
NN.Matrix([5,1],[5,1],sigmaR=sigmaR),
NN.Addition([5,1],sigmaR=sigmaR),
NN.ComponentwiseFunction(),
# output
#Matrix([5,1],[2,1],sigmaR=sigmaR),
#Addition([2,1],sigmaR=sigmaR)
NN.Matrix([5,1],[3,1],sigmaR=sigmaR),
NN.Addition([3,1],sigmaR=sigmaR)
])
# a nice simple interface
nn = NN.makeStandardNeuralNet(inputDim=2,outputDim=3,interDim=20,nInter=5,sigmaR=sigmaR)
# simple training set in 2D
n = 100
x = np.zeros([2,1,n])
z = np.zeros([2,1,n])
for i in range(n):
off = np.random.rand() > 0.5
x[:,:,i] = np.random.randn(2,1) + off*3
z[0,:,i] = float(off)
z[1,:,i] = 1.0 - float(off)
n = 200
x = np.zeros([2,1,n])
z = np.zeros([3,1,n])
for i in range(n):
category = np.random.randint(3)