先上代码
class neuralNetwork:
def __int__(self , inputnodes, hiddennodes, outputnodes, learningrate):
self.inodes = inputnodes
self.hnodes = hiddennodes
self.onodes = outputnodes
self.lr = learningrate
input_nodes = 3
hidden_nodes = 3
output_nodes = 3
learning_rate = 0.5
n = neuralNetwork(input_nodes,hidden_nodes,output_nodes,learning_rate)
但是实际上,init__写成了__int。
可能上辈子我是个整型吧。