Implements a dropout layer for machine learning, which randomly sets input values to zero during training.
More...
#include <Dropout.h>
|
| | Dropout (float p) |
| | Constructor for Dropout.
|
| |
| void | apply (const SelectivityVector &rows, std::vector< VectorPtr > &args, const TypePtr &type, exec::EvalCtx &context, VectorPtr &output) const override |
| | Applies the dropout function to the input data.
|
| |
| float * | getTensor () const override |
| | Returns the tensor associated with the function.
|
| |
| void | setWeight (float p) |
| | Sets the dropout probability.
|
| |
|
virtual | ~MLFunction ()=default |
| | Virtual destructor.
|
| |
| virtual std::vector< int > | getDims () |
| | Returns the dimensions of the function.
|
| |
| virtual std::string | getFuncName () |
| | Returns the name 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 std::vector< std::shared_ptr< exec::FunctionSignature > > | signatures () |
| | Returns the function signatures.
|
| |
| static std::string | getName () |
| | Returns the name of the function.
|
| |
|
| 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.
|
| |
|
std::vector< int > | dims |
| | Dimensions of the function.
|
| |
Implements a dropout layer for machine learning, which randomly sets input values to zero during training.
◆ Dropout()
| Dropout::Dropout |
( |
float | p | ) |
|
|
inline |
Constructor for Dropout.
- Parameters
-
| p | The probability of dropping out an input value (setting it to zero). |
◆ apply()
| void Dropout::apply |
( |
const SelectivityVector & | rows, |
|
|
std::vector< VectorPtr > & | args, |
|
|
const TypePtr & | type, |
|
|
exec::EvalCtx & | context, |
|
|
VectorPtr & | output ) const |
|
inlineoverride |
Applies the dropout function to the input data.
- Parameters
-
| rows | Selectivity vector indicating which rows to process. |
| args | Vector of input arguments. |
| type | Type of the output vector. |
| context | Evaluation context. |
| output | Output vector to store the results. |
◆ getName()
| static std::string Dropout::getName |
( |
| ) |
|
|
inlinestatic |
Returns the name of the function.
- Returns
- Function name.
◆ getTensor()
| float * Dropout::getTensor |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the tensor associated with the function.
- Returns
- Pointer to the tensor.
Implements MLFunction.
◆ setWeight()
| void Dropout::setWeight |
( |
float | p | ) |
|
|
inline |
Sets the dropout probability.
- Parameters
-
| p | The probability of dropping out an input value (setting it to zero). |
◆ signatures()
| static std::vector< std::shared_ptr< exec::FunctionSignature > > Dropout::signatures |
( |
| ) |
|
|
inlinestatic |
Returns the function signatures.
- Returns
- Vector of function signatures.
The documentation for this class was generated from the following file: