class that infers linear model it supports multiple fully connected hidden layers and calculates multiple outputs focusing on classification It features an optional sigmoid and a relu activation function
More...
#include <LinearModel.h>
|
| | LinearModel (const std::vector< Eigen::MatrixXf > &weights, const std::vector< Eigen::VectorXf > &biases, const Eigen::MatrixXf &weightsOutput, const Eigen::VectorXf &biasOutput, const StringArray &categories) |
| | Constructor for the linear model this will be called to set manually the parametrs of the model.
|
| |
| | LinearModel () |
| | Constructor for the linear model, this will automatically load a model that is expected to exist in the binary data.
|
| |
| Eigen::VectorXf | infer (const Eigen::VectorXf &input) |
| | infers the model to predict output
|
| |
| Eigen::VectorXf | inferSingle (const Eigen::VectorXf &input) |
| |
| String | getProminentCategory () |
| | returns the prominent category name
|
| |
| StringArray | getOutputCategories () |
| | returns the output categories
|
| |
| void | loadModelData () |
| |
|
| Eigen::VectorXf | sigmoid (const Eigen::VectorXf &lOut) |
| | sigmoid activation function
|
| |
| Eigen::VectorXf | relu (const Eigen::VectorXf &lOut) |
| | relu activation function
|
| |
class that infers linear model it supports multiple fully connected hidden layers and calculates multiple outputs focusing on classification It features an optional sigmoid and a relu activation function
◆ LinearModel() [1/2]
| krotos::LinearModel::LinearModel |
( |
const std::vector< Eigen::MatrixXf > & | weights, |
|
|
const std::vector< Eigen::VectorXf > & | biases, |
|
|
const Eigen::MatrixXf & | weightsOutput, |
|
|
const Eigen::VectorXf & | biasOutput, |
|
|
const StringArray & | categories ) |
Constructor for the linear model this will be called to set manually the parametrs of the model.
- Parameters
-
| w | the weights vector |
| b | layer bias |
◆ LinearModel() [2/2]
| krotos::LinearModel::LinearModel |
( |
| ) |
|
Constructor for the linear model, this will automatically load a model that is expected to exist in the binary data.
◆ getOutputCategories()
| StringArray krotos::LinearModel::getOutputCategories |
( |
| ) |
|
returns the output categories
◆ getProminentCategory()
| String krotos::LinearModel::getProminentCategory |
( |
| ) |
|
returns the prominent category name
◆ infer()
| Eigen::VectorXf krotos::LinearModel::infer |
( |
const Eigen::VectorXf & | input | ) |
|
infers the model to predict output
- Parameters
-
| input | the input data to predict |
- Returns
- output scores for each category
◆ inferSingle()
| Eigen::VectorXf krotos::LinearModel::inferSingle |
( |
const Eigen::VectorXf & | input | ) |
|
◆ loadModelData()
| void krotos::LinearModel::loadModelData |
( |
| ) |
|
@rief loads the model data from binary data and sets up the relevant variables
◆ relu()
| Eigen::VectorXf krotos::LinearModel::relu |
( |
const Eigen::VectorXf & | lOut | ) |
|
|
private |
◆ sigmoid()
| Eigen::VectorXf krotos::LinearModel::sigmoid |
( |
const Eigen::VectorXf & | lOut | ) |
|
|
private |
sigmoid activation function
◆ m_bias
| std::vector<Eigen::VectorXf> krotos::LinearModel::m_bias |
|
private |
◆ m_biasOutput
| Eigen::VectorXf krotos::LinearModel::m_biasOutput |
|
private |
◆ m_layerOutput
| std::vector<Eigen::VectorXf> krotos::LinearModel::m_layerOutput |
|
private |
◆ m_layerSize
| int krotos::LinearModel::m_layerSize {0} |
|
private |
◆ m_numLayers
| int krotos::LinearModel::m_numLayers {0} |
|
private |
◆ m_outputCategories
| StringArray krotos::LinearModel::m_outputCategories |
|
private |
◆ m_outputs
| Eigen::VectorXf krotos::LinearModel::m_outputs |
|
private |
◆ m_outputSize
| int krotos::LinearModel::m_outputSize {0} |
|
private |
◆ m_prominentCategoryIndex
| int krotos::LinearModel::m_prominentCategoryIndex = {0} |
|
private |
◆ m_weights
| std::vector<Eigen::MatrixXf> krotos::LinearModel::m_weights |
|
private |
◆ m_weightsOutput
| Eigen::MatrixXf krotos::LinearModel::m_weightsOutput |
|
private |
◆ m_weightsVar
| var krotos::LinearModel::m_weightsVar |
|
private |
◆ m_workingBuffer
| Eigen::VectorXf krotos::LinearModel::m_workingBuffer |
|
private |
The documentation for this class was generated from the following files: