Sgd, Machine Learning, Stochastic Gradient.
1/(1+np.exp(-(x@self.w+self.b))) def log_loss(self, x, y): log_loss, infi = 0, 1e-90 for x1, y1 in zip(x, y): prob_pos_class = self.sigmoid(x1) # adding 1e-90 to avoid log(0) math error log_loss += y1*np.log(prob_pos_class+infi) + (1-y1)*np.log(1-prob_pos_class+infi) return -log_loss/x.shape[0] def