Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python错误SyntaxError:无效语法,无特殊原因_Python_Jupyter - Fatal编程技术网

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)))