ML functions
 
Loading...
Searching...
No Matches
Convolute Class Reference

A class for performing 2D convolution operations as part of a machine learning function. More...

#include <functions.h>

Inheritance diagram for Convolute:
MLFunction

Public Member Functions

 Convolute (float *weights, int *dims_)
 Constructs a new Convolute object.
 
void apply (const SelectivityVector &rows, std::vector< VectorPtr > &args, const TypePtr &type, exec::EvalCtx &context, VectorPtr &output) const override
 Applies the 2D convolution operation to the input data.
 
float * getTensor () const override
 Returns the filter weights tensor.
 
std::string getFuncName ()
 Returns the name of the function.
 
- Public Member Functions inherited from MLFunction
virtual ~MLFunction ()=default
 Virtual destructor.
 
virtual std::vector< int > getDims ()
 Returns the dimensions of the function.
 
virtual int getNumDims ()
 Returns the number of dimensions of the function.
 
virtual CostEstimate getCost (std::vector< int > inputDims)
 Estimates the computational cost of applying the function.
 

Static Public Member Functions

static std::vector< std::shared_ptr< exec::FunctionSignature > > signatures ()
 Returns the function signatures for the convolution operation.
 
static std::string getName ()
 Returns the name of the function.
 

Additional Inherited Members

- Protected Member Functions inherited from MLFunction
double getWeightedCost (std::string name, float cost)
 Calculates the weighted cost of the function.
 
std::vector< double > getCoefficientVector (std::string name)
 Retrieves the cost coefficients for the function.
 
- Protected Attributes inherited from MLFunction
std::vector< int > dims
 Dimensions of the function.
 

Detailed Description

A class for performing 2D convolution operations as part of a machine learning function.

This class implements a 2D convolution operation using Eigen for matrix operations. It supports multi-channel inputs and filters, and produces multi-channel outputs.

Constructor & Destructor Documentation

◆ Convolute()

Convolute::Convolute ( float * weights,
int * dims_ )
inline

Constructs a new Convolute object.

Parameters
weightsA pointer to the filter weights.
dims_An array of dimensions describing the filters and input:
  • dims_[0]: Number of filters.
  • dims_[1]: Filter height.
  • dims_[2]: Filter width.
  • dims_[3]: Number of input channels.
  • dims_[4]: Input height.
  • dims_[5]: Input width.

Member Function Documentation

◆ apply()

void Convolute::apply ( const SelectivityVector & rows,
std::vector< VectorPtr > & args,
const TypePtr & type,
exec::EvalCtx & context,
VectorPtr & output ) const
inlineoverride

Applies the 2D convolution operation to the input data.

Parameters
rowsA SelectivityVector indicating which rows to process.
argsA vector of input arguments (only the first argument is used).
typeThe type of the output vector.
contextThe evaluation context.
outputThe output vector where the results will be stored.

◆ getFuncName()

std::string Convolute::getFuncName ( )
inlinevirtual

Returns the name of the function.

Returns
A string representing the function name.

Reimplemented from MLFunction.

◆ getName()

static std::string Convolute::getName ( )
inlinestatic

Returns the name of the function.

Returns
A string representing the function name.

◆ getTensor()

float * Convolute::getTensor ( ) const
inlineoverridevirtual

Returns the filter weights tensor.

Returns
A pointer to the filter weights.

Implements MLFunction.

◆ signatures()

static std::vector< std::shared_ptr< exec::FunctionSignature > > Convolute::signatures ( )
inlinestatic

Returns the function signatures for the convolution operation.

Returns
A vector of shared pointers to FunctionSignature objects.

The documentation for this class was generated from the following file: