6 #ifndef TENSORMATH_HPP_INCLUDE
7 #define TENSORMATH_HPP_INCLUDE
Class to perform operations on 1D and 2D Tensors, aka vectors and matrices, suitable for use in feed-...
Definition: TensorMath.hpp:21
static std::shared_ptr< TensorMath > make_shared()
Returns a shared_ptr to a concrete object constructed using the underlying implementation.
Definition: TensorMath.cpp:23
virtual double inner_product(const TensorOneD &tensor_a, const TensorOneD &tensor_b) const =0
Multiply two 1D tensors, element-wise, and sum the result.
virtual TensorOneD subtract(const TensorOneD &tensor_a, const TensorOneD &tensor_b) const =0
Subtract two 1D tensors of the same length, element-wise.
virtual TensorOneD multiply(const TensorTwoD &, const TensorOneD &) const =0
Multiply a 2D tensor by a 1D tensor.
virtual ~TensorMath()=default
virtual TensorOneD sigmoid(const TensorOneD &tensor) const =0
Compute logistic sigmoid function of 1D Tensor.
virtual TensorOneD add(const TensorOneD &tensor_a, const TensorOneD &tensor_b) const =0
Add two 1D tensors of the same length, element-wise.
Definition: TensorMath.hpp:69
double inner_product(const TensorOneD &tensor_a, const TensorOneD &tensor_b) const override
Multiply two 1D tensors, element-wise, and sum the result.
Definition: TensorMath.cpp:68
TensorOneD subtract(const TensorOneD &tensor_a, const TensorOneD &tensor_b) const override
Subtract two 1D tensors of the same length, element-wise.
Definition: TensorMath.cpp:48
virtual ~TensorMathImp()=default
TensorOneD add(const TensorOneD &tensor_a, const TensorOneD &tensor_b) const override
Add two 1D tensors of the same length, element-wise.
Definition: TensorMath.cpp:28
TensorOneD sigmoid(const TensorOneD &tensor) const override
Compute logistic sigmoid function of 1D Tensor.
Definition: TensorMath.cpp:83
TensorOneD multiply(const TensorTwoD &, const TensorOneD &) const override
Multiply a 2D tensor by a 1D tensor.
Definition: TensorMath.cpp:101
Class to store and perform operations on 1D Tensors, aka vectors, suitable for use in feed-forward ne...
Definition: TensorOneD.hpp:21
Class to manage data and operations related to 2D Tensors required for neural net inference.
Definition: TensorTwoD.hpp:22
Definition: Accumulator.cpp:12