def score(self, input_data, target): data = np.hstack((input_data, -np.ones((shape(input_data)[0], 1)))) output = threshold(self.fwd(data)) m = data.shape[0] s = np.sum([(output[i]==target[i]).all() for i in range(m)]) return float(s) / float(m) * 100.0
def predict(self, test_input): data = np.hstack((test_input, -np.ones((shape(test_input)[0], 1)))) return threshold(self.fwd(data))