(self,inputs,targets,nhidden,beta=1,momentum=0.9,outtype='logistic')
Constructor
Constructor
Constructor
def __init__(self,inputs,targets,nhidden,beta=1,momentum=0.9,outtype='logistic'):
        """ Constructor """
        # Set up network size
        self.nin = np.shape(inputs)[1]
        self.nout = np.shape(targets)[1]
        self.ndata = np.shape(inputs)[0]
        self.nhidden = nhidden

        self.beta = beta
        self.momentum = momentum
        self.outtype = outtype
    
        # Initialise network
        self.weights1 = (np.random.rand(self.nin+1,self.nhidden)-0.5)*2/np.sqrt(self.nin)
        self.weights2 = (np.random.rand(self.nhidden+1,self.nout)-0.5)*2/np.sqrt(self.nhidden)
def __init__ ( self , inputs , targets , nhidden , beta = 1 , momentum = 0.9 , outtype = 'logistic' ) : # Set up network size self . nin = np . shape ( inputs ) [ 1 ] self . nout = np . shape ( targets ) [ 1 ] self . ndata = np . shape ( inputs ) [ 0 ] self . nhidden = nhidden self . beta = beta self . momentum = momentum self . outtype = outtype # Initialise network self . weights1 = ( np . random . rand ( self . nin + 1 , self . nhidden ) - 0.5 ) * 2 / np . sqrt ( self . nin ) self . weights2 = ( np . random . rand ( self . nhidden + 1 , self . nout ) - 0.5 ) * 2 / np . sqrt ( self . nhidden )