6 #ifndef TENSORONED_HPP_INCLUDE
7 #define TENSORONED_HPP_INCLUDE
47 TensorOneD(
const std::vector<double> &input, std::shared_ptr<TensorMath> math);
96 const std::vector<double> &
get_data()
const;
100 std::vector<double> m_vec;
101 std::shared_ptr<TensorMath> m_math;
Class to store and perform operations on 1D Tensors, aka vectors, suitable for use in feed-forward ne...
Definition: TensorOneD.hpp:21
double & operator[](size_t idx)
Reference indexing of 1D tensor value at idx.
Definition: TensorOneD.cpp:78
bool operator==(const TensorOneD &other) const
Overload == operator to do comparison of the underlying.
Definition: TensorOneD.cpp:73
const std::vector< double > & get_data() const
Return the tensor as a vector of doubles.
Definition: TensorOneD.cpp:88
TensorOneD operator+(const TensorOneD &other) const
Definition: TensorOneD.cpp:93
virtual ~TensorOneD()=default
void set_dim(size_t dim)
Set length of 1D tensor.
Definition: TensorOneD.cpp:47
size_t get_dim() const
Get the length of the 1D tensor.
Definition: TensorOneD.cpp:52
double operator*(const TensorOneD &other) const
Definition: TensorOneD.cpp:103
TensorOneD sigmoid() const
Definition: TensorOneD.cpp:108
TensorOneD()
Definition: TensorOneD.cpp:15
TensorOneD operator-(const TensorOneD &other) const
Definition: TensorOneD.cpp:98
TensorOneD & operator=(const TensorOneD &other)
Overload = operator with an in-place deep copy.
Definition: TensorOneD.cpp:57
Definition: Accumulator.cpp:12