MCPcopy Create free account
hub / github.com/geekcomputers/Python / update

Method update

ML/src/python/neuralforge/utils/metrics.py:127–129  ·  view source on GitHub ↗
(self, predictions: np.ndarray, targets: np.ndarray)

Source from the content-addressed store, hash-verified

125 self.matrix = np.zeros((num_classes, num_classes), dtype=np.int64)
126
127 def update(self, predictions: np.ndarray, targets: np.ndarray):
128 for pred, target in zip(predictions, targets):
129 self.matrix[target, pred] += 1
130
131 def reset(self):
132 self.matrix = np.zeros((self.num_classes, self.num_classes), dtype=np.int64)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected