(self,inputs)
Run the network forward
Run the network forward
Run the network forward
def mlpfwd(self,inputs):
        """ Run the network forward """

        self.hidden = np.dot(inputs,self.weights1);
        self.hidden = 1.0/(1.0+np.exp(-self.beta*self.hidden))
        self.hidden = np.concatenate((self.hidden,-np.ones((np.shape(inputs)[0],1))),axis=1)

        outputs = np.dot(self.hidden,self.weights2);

        # Different types of output neurons
        if self.outtype == 'linear':
        	return outputs
        elif self.outtype == 'logistic':
            	return 1.0/(1.0+np.exp(-self.beta*outputs))
        elif self.outtype == 'softmax':
            	normalisers = np.sum(np.exp(outputs),axis=1)*np.ones((1,np.shape(outputs)[0]))
            	return np.transpose(np.transpose(np.exp(outputs))/normalisers)
        else:
            	print "error"
def mlpfwd ( self , inputs ) : self . hidden = np . dot ( inputs , self . weights1 ) self . hidden = 1.0 / ( 1.0 + np . exp ( - self . beta * self . hidden ) ) self . hidden = np . concatenate ( ( self . hidden , - np . ones ( ( np . shape ( inputs ) [ 0 ] , 1 ) ) ) , axis = 1 ) outputs = np . dot ( self . hidden , self . weights2 ) # Different types of output neurons if self . outtype == 'linear' : return outputs elif self . outtype == 'logistic' : return 1.0 / ( 1.0 + np . exp ( - self . beta * outputs ) ) elif self . outtype == 'softmax' : normalisers = np . sum ( np . exp ( outputs ) , axis = 1 ) * np . ones ( ( 1 , np . shape ( outputs ) [ 0 ] ) ) return np . transpose ( np . transpose ( np . exp ( outputs ) ) / normalisers ) else : print "error"