CppMatrix
Loading...
Searching...
No Matches
cpp_matrix.nn Module Reference

Concepts

concept  cpp_matrix::nn::Backend
 

Classes

class  cpp_matrix::nn::Linear< Matrix >
 
class  cpp_matrix::nn::Tensor< Matrix >
 Tensor is a matrix supports auto grad. More...
 

Typedefs

using ElementType = typename Matrix::ElementType
 

Functions

template<Backend Matrix>
Tensor< Matrixcpp_matrix::nn::functional::sigmoid (const Tensor< Matrix > &input)
 Applies the element-wise function \( Sigmoid(x) \).
 
template<Backend Matrix>
Tensor< Matrixcpp_matrix::nn::functional::mse_loss (const Tensor< Matrix > &input, const Tensor< Matrix > &target)
 Measure the element-wise Mean Squared Error.
 
 Tensor (Matrix m)
 Initialize a tensor with matrix data.
 
 Tensor (std::initializer_list< std::initializer_list< ElementType > > initData)
 Initialize a tensor with init data.
 
 Tensor (const Tensor &other)
 
 Tensor (Tensor &&other)
 
size_t Row () const
 
size_t Column () const
 
Tensor operator- () const
 
Tensor operator+ (ElementType v) const
 
Tensor operator- (const Tensor &other) const
 
Tensor operator* (const Tensor &other) const
 
Tensor AddToRow (const Tensor &other) const
 
Tensor Pow (ElementType n) const
 
Tensor operator+ (const Tensor &other) const
 
Tensor operator* (ElementType n) const
 
Tensor operator/ (ElementType n) const
 
Tensor Exp () const
 
ElementType operator[] (size_t row, size_t column) const
 
Tensor DivBy (ElementType v) const
 Applies the element-wise function: v / x.
 
Tensor Sum () const
 Returns the sum of all elements in the tensor.
 
Tensor Derivative (const Tensor &x) const
 Get derivative of tensor at x.
 
Tensor SumX () const
 Returns the sum of all elements in the tensor.
 

Files

file  /__w/CppMatrix/CppMatrix/src/nn/module.cpp
 
file  /__w/CppMatrix/CppMatrix/src/nn/backend.cpp
 
file  /__w/CppMatrix/CppMatrix/src/nn/modules/linear.cpp
 
file  /__w/CppMatrix/CppMatrix/src/nn/functional/module.cpp
 
file  /__w/CppMatrix/CppMatrix/src/nn/modules/module.cpp
 
file  /__w/CppMatrix/CppMatrix/src/nn/functional/mse_loss.cpp
 
file  /__w/CppMatrix/CppMatrix/src/nn/functional/sigmoid.cpp
 
file  /__w/CppMatrix/CppMatrix/src/nn/tensor.cpp