Class to perform operations on 1D and 2D Tensors, aka vectors and matrices, suitable for use in feed-forward neural networks.
More...
#include <TensorMath.hpp>
|
static std::shared_ptr< TensorMath > | make_shared () |
| Returns a shared_ptr to a concrete object constructed using the underlying implementation. More...
|
|
Class to perform operations on 1D and 2D Tensors, aka vectors and matrices, suitable for use in feed-forward neural networks.
◆ ~TensorMath()
virtual geopm::TensorMath::~TensorMath |
( |
| ) |
|
|
virtualdefault |
◆ add()
Add two 1D tensors of the same length, element-wise.
- Exceptions
-
geopm::Exception | if the lengths do not match. |
- Parameters
-
- Returns
- Returns a 1D tensor, the sum of two 1D tensors
Implemented in geopm::TensorMathImp.
◆ inner_product()
virtual double geopm::TensorMath::inner_product |
( |
const TensorOneD & |
tensor_a, |
|
|
const TensorOneD & |
tensor_b |
|
) |
| const |
|
pure virtual |
Multiply two 1D tensors, element-wise, and sum the result.
- Exceptions
-
geopm::Exception | if the lengths do not match. |
- Parameters
-
[in] | other | The multiplicand |
- Returns
- Returns a 1D tensor, the product of two 1D tensors
Implemented in geopm::TensorMathImp.
◆ make_shared()
std::shared_ptr< TensorMath > geopm::TensorMath::make_shared |
( |
void |
| ) |
|
|
static |
Returns a shared_ptr to a concrete object constructed using the underlying implementation.
◆ multiply()
Multiply a 2D tensor by a 1D tensor.
- Parameters
-
[in] | TensorTwoD& | Reference to the 2D multiplicand |
[in] | TensorOneD& | Reference to the 1D multiplicand |
- Exceptions
-
geopm::Exception | if the sizes are incompatible, i.e. if 2D tensor number of columns is unequal to 1D tensor number of rows |
Implemented in geopm::TensorMathImp.
◆ sigmoid()
◆ subtract()
Subtract two 1D tensors of the same length, element-wise.
- Exceptions
-
geopm::Exception | if the lengths do not match. |
- Parameters
-
- Returns
- A 1D tensor, the difference of two 1D tensors.
Implemented in geopm::TensorMathImp.
The documentation for this class was generated from the following files: