MCPcopy
hub / github.com/MingchaoZhu/DeepLearning / line_search

Function line_search

code/chapter7.py:558–561  ·  view source on GitHub ↗
(self, y, y_pred, h_pred)

Source from the content-addressed store, hash-verified

556
557
558def 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
564def to_categorical(x, n_classes=None):

Callers 1

fitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected