Python错误SyntaxError:无效语法,无特殊原因
我有一个Python错误SyntaxError:无效语法,无特殊原因,python,jupyter,Python,Jupyter,我有一个语法错误,没有明显的原因。我知道Python有时会给出错误的一行。但我也检查了之前的线路,没有发现任何错误线路 import math import numpy class neuralNetwork: def __init__ (self,inputnodes,hiddennodes,outputnodes,learningrate): #set number of nodes in each input, hidden, output la
语法错误
,没有明显的原因。我知道Python有时会给出错误的一行。但我也检查了之前的线路,没有发现任何错误线路
import math
import numpy
class neuralNetwork:
def __init__ (self,inputnodes,hiddennodes,outputnodes,learningrate):
#set number of nodes in each input, hidden, output layer
self.inodes= inputnodes
self.hnodes= hiddennodes
self.onodes= outputnodes
```
self.wih = (numpy.random.normal(0.0,pow(self.hnodes,- 0.5),
(self.hnodes,self.inodes))
self.who = (numpy.random.normal(0.0,pow(self.hnodes,- 0.5),
(self.hnodes,self.inodes))
```
# learning rate
elf.lr = learningrate
pass
def train():
pass
def query():
pass
文件“”,第13行
self.who=(numpy.random.normal(0.0,pow(self.hnodes,-0.5),(self.hnodes,self.inode))
^
SyntaxError:无效语法
你忘了一个)
:
数一数你的括号。
File "<ipython-input-53-3e0b0716fcb1>", line 13
self.who = (numpy.random.normal(0.0,pow(self.hnodes,- 0.5),(self.hnodes,self.inodes))
^
SyntaxError: invalid syntax
self.wih = (numpy.random.normal(0.0,pow(self.hnodes,- 0.5),
(self.hnodes,self.inodes)))