iVS3D v2.0.0
Loading...
Searching...
No Matches
NN::Util Namespace Reference

Namespace for utility functions related to neural networks and tensors. More...

Functions

template<typename ReduceOp >
auto bind_reduce (ReduceOp op, int axis)
 Binds a reduction operation on a specified axis for a tensor.
 
template<typename ReduceIndexOp >
auto bind_reduceWithIndex (ReduceIndexOp op, int axis)
 Binds a reduction operation with index on a specified axis for a tensor.
 
template<typename Func >
auto bind_map (Func f)
 Binds a mapping operation on a tensor.
 
template<typename Func >
auto bind_map (Func f, int axis)
 Binds a mapping operation on a tensor that converts a each element to an array of new elements.
 
template<typename... Args>
auto bind_reshape (const std::vector< int64_t > &newShape)
 Binds a reshape operation to change the shape of a tensor.
 
template<typename... Args>
auto bind_squeeze ()
 Binds a squeeze operation to remove dimensions of size 1 from a tensor.
 
template<typename... Args>
auto bind_squeeze (int64_t axis)
 Binds a squeeze operation on a tensor along a specified axis.
 
template<typename... Args>
auto bind_unsqueeze (int64_t axis)
 Binds an unsqueeze operation to add a new dimension of size 1 at a specified axis in a tensor.
 
template<typename... Args>
auto bind_toCvMat ()
 Binds a conversion operation from a tensor to an OpenCV Mat format.
 
template<typename T , typename... Args>
auto bind_toVector ()
 Binds a conversion operation from a tensor to a vector.
 
template<typename... Args>
auto bind_inference (NN::NeuralNetPtr model)
 Binds an inference operation on a neural network model.
 

Detailed Description

Namespace for utility functions related to neural networks and tensors.

This namespace contains functions to bind tensor operations such as reduction, mapping, reshaping, squeezing, unsqueezing, and converting to OpenCV Mat format. These functions are designed to be used with the Tensor class and can be easily integrated into neural network workflows. The functions return callable objects that can be used with tl::expected::and_then for chaining operations.