Beispiel #1
0
 def predict(self, X):
     """Return the probability of x belonging to either class"""
     
     hidden = sigmoid(self.Wh @ X + self.bh)
     scores = self.Ws @ hidden + self.bs
     probs = softmax_vectorized(scores)
     
     return probs.argmax(axis=0)
Beispiel #2
0
 def forward(self, z):
     self.h = sigmoid(z)
     
     return self.h
Beispiel #3
0
 def forward(self, Z):
     self.h = sigmoid(Z)
     
     return self.h