(self, y, y_pred, h_pred)
| 556 | |
| 557 | |
| 558 | def line_search(self, y, y_pred, h_pred): |
| 559 | Lp = 2 * np.sum((y - y_pred) * h_pred) |
| 560 | Lpp = np.sum(h_pred * h_pred) |
| 561 | return 1 if np.sum(Lpp) == 0 else Lp / Lpp |
| 562 | |
| 563 | |
| 564 | def to_categorical(x, n_classes=None): |