CNum 0.2.1
CPU-optimized ML library for C++
Loading...
Searching...
No Matches
CNum::Model::ModelPool< ModelType > Class Template Reference

A pool of trained models. More...

#include <ModelPool.h>

Public Member Functions

 ModelPool (::std::string path, size_t n_models=20)
 Overloaded default constructor.
 ModelPool (const ModelPool &)=delete
ModelPooloperator= (const ModelPool &)=delete
 ~ModelPool ()
 Destructor.
ModelType * pull ()
 Pull a model from the pool.
void push (ModelType *model)
 Push a model to the pool model A raw pointer to a trained model pulled from the pool.

Detailed Description

template<typename ModelType>
class CNum::Model::ModelPool< ModelType >

A pool of trained models.

Constructor & Destructor Documentation

◆ ModelPool() [1/2]

template<typename ModelType>
CNum::Model::ModelPool< ModelType >::ModelPool ( ::std::string path,
size_t n_models = 20 )

Overloaded default constructor.

Parameters
pathPath to your trained model (.cmod)
n_modelsThe number of models in the pool

◆ ModelPool() [2/2]

template<typename ModelType>
CNum::Model::ModelPool< ModelType >::ModelPool ( const ModelPool< ModelType > & )
delete

◆ ~ModelPool()

template<typename ModelType>
CNum::Model::ModelPool< ModelType >::~ModelPool ( )

Destructor.

Member Function Documentation

◆ operator=()

template<typename ModelType>
ModelPool & CNum::Model::ModelPool< ModelType >::operator= ( const ModelPool< ModelType > & )
delete

◆ pull()

template<typename ModelType>
ModelType * CNum::Model::ModelPool< ModelType >::pull ( )

Pull a model from the pool.

Returns
A raw pointer to a trained model

◆ push()

template<typename ModelType>
void CNum::Model::ModelPool< ModelType >::push ( ModelType * model)

Push a model to the pool model A raw pointer to a trained model pulled from the pool.


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