本文整理汇总了Python中NeuralNetwork.NeuralNetwork.declareInput方法的典型用法代码示例。如果您正苦于以下问题:Python NeuralNetwork.declareInput方法的具体用法?Python NeuralNetwork.declareInput怎么用?Python NeuralNetwork.declareInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NeuralNetwork.NeuralNetwork
的用法示例。
在下文中一共展示了NeuralNetwork.declareInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Normalize
# 需要导入模块: from NeuralNetwork import NeuralNetwork [as 别名]
# 或者: from NeuralNetwork.NeuralNetwork import declareInput [as 别名]
dataColumn = Normalize(dataColumn)
length = len(dataColumn)
InputLayer.append(dataColumn)
dataColumn = []
return InputLayer,length
def Normalize(dataColumn):
#print dataColumn
newDataColumn = []
maximum = max(dataColumn)
minimum = min(dataColumn)
for each in dataColumn:
norm = (each - minimum)/(maximum-minimum)
newDataColumn.append(norm)
#print norm
return newDataColumn
InputArray,length = getData()
OutputLayer = np.array([InputArray[1]])
ones = [1]*length
#InputLayer = np.array([InputArray[0],InputArray[2],InputArray[3],ones])
InputLayer = np.array([InputArray[0],ones])
InputLayer = InputLayer.T
y = OutputLayer.T
nn = NeuralNetwork(4,4)
nn.declareInput(InputLayer)
nn.declareTarget(y)
nn.train(1000000)