def _backward(self, grad_act, input_act):
        input_act = input_act.reshape((-1,self.weights_.shape[0]))

        grad_input_act = np.dot(grad_act, self.weights_.T)
        grad_input_act = grad_input_act.reshape((-1,) + tuple(self.input_shape))

        grad_params = np.array([np.outer(act, grad) for act, grad in zip(input_act, grad_act)])
        grad_params = grad_params.mean(0)

        return grad_input_act, grad_params
dataset/ETHPy150Open bbabenko/simple_convnet/simple_convnet/convnet.py/DenseLayer._backward/original