Exemplo n.º 1
0
    def propogate_forward(self, activations: Matrix, weights: Matrix,
                          biases: Matrix,
                          activation: Callable[[Scalar], Scalar]) -> Matrix:
        z = weights.dot(activations) + biases
        next_layer_activations = z.apply(activation)
        self.__cache.append(CacheEntry(z, activations))

        return next_layer_activations
Exemplo n.º 2
0
 def test_dot(self, name: str, left: Matrix, right: Matrix, result: Matrix):
     self.assertMatrixAreEqual(left.dot(right), result)