Vowpal Wabbit
|
Contains the VW::LEARNER::learner object and utilities for interacting with it. More...
Classes | |
struct | base_learner_builder |
struct | common_learner_builder |
struct | finish_example_data |
struct | func_data |
struct | learn_data |
struct | learner |
Defines the interface for a learning algorithm. More... | |
struct | reduction_learner_builder |
struct | reduction_no_data_learner_builder |
struct | save_load_data |
struct | save_metric_data |
struct | sensitivity_data |
Typedefs | |
using | base_learner = learner< char, char > |
Used to type erase the object and pass around common type. More... | |
using | single_learner = learner< char, example > |
Used for reductions that process single example objects at at time. It type erases the specific reduction object type. More... | |
using | multi_learner = learner< char, multi_ex > |
Used for multiline examples where there are several example objects required to describe the overall example. It type erases the specific reduction object type. More... | |
Functions | |
func_data | tuple_dbf (void *data, base_learner *base, void(*func)(void *)) |
void | generic_driver (vw &all) |
void | generic_driver (const std::vector< vw * > &alls) |
void | generic_driver_onethread (vw &all) |
void | noop_save_load (void *, io_buf &, bool, bool) |
void | noop_persist_metrics (void *, metric_sink &) |
void | noop (void *) |
float | noop_sensitivity (void *, base_learner &, example &) |
float | recur_sensitivity (void *, base_learner &, example &) |
void | debug_increment_depth (example &ex) |
void | debug_increment_depth (multi_ex &ec_seq) |
void | debug_decrement_depth (example &ex) |
void | debug_decrement_depth (multi_ex &ec_seq) |
void | increment_offset (example &ex, const size_t increment, const size_t i) |
void | increment_offset (multi_ex &ec_seq, const size_t increment, const size_t i) |
void | decrement_offset (example &ex, const size_t increment, const size_t i) |
void | decrement_offset (multi_ex &ec_seq, const size_t increment, const size_t i) |
bool | ec_is_example_header (example const &ec, label_type_t label_type) |
template<class T , class E , class L > | |
learner< T, E > & | init_learner (free_ptr< T > &dat, L *base, void(*learn)(T &, L &, E &), void(*predict)(T &, L &, E &), size_t ws, prediction_type_t pred_type, const std::string &name, bool learn_returns_prediction=false) |
template<class T , class E , class L > | |
learner< T, E > & | init_learner (free_ptr< T > &dat, void(*learn)(T &, L &, E &), void(*predict)(T &, L &, E &), size_t params_per_weight, const std::string &name, bool learn_returns_prediction=false) |
template<class T , class E , class L > | |
learner< T, E > & | init_learner (void(*predict)(T &, L &, E &), size_t params_per_weight, const std::string &name) |
template<class T , class E , class L > | |
learner< T, E > & | init_learner (free_ptr< T > &dat, void(*learn)(T &, L &, E &), void(*predict)(T &, L &, E &), size_t params_per_weight, prediction_type_t pred_type, const std::string &name, bool learn_returns_prediction=false) |
template<class T , class E , class L > | |
learner< T, E > & | init_learner (free_ptr< T > &dat, L *base, void(*learn)(T &, L &, E &), void(*predict)(T &, L &, E &), size_t ws, const std::string &name, bool learn_returns_prediction=false) |
template<class T , class E , class L > | |
learner< T, E > & | init_learner (free_ptr< T > &dat, L *base, void(*learn)(T &, L &, E &), void(*predict)(T &, L &, E &), const std::string &name, bool learn_returns_prediction=false) |
template<class T , class E , class L > | |
learner< T, E > & | init_learner (L *base, void(*learn)(T &, L &, E &), void(*predict)(T &, L &, E &), const std::string &name, bool learn_returns_prediction=false) |
template<class T , class E , class L > | |
learner< T, E > & | init_multiclass_learner (free_ptr< T > &dat, L *base, void(*learn)(T &, L &, E &), void(*predict)(T &, L &, E &), parser *p, size_t ws, const std::string &name, prediction_type_t pred_type=prediction_type_t::multiclass, bool learn_returns_prediction=false) |
template<class T , class E , class L > | |
learner< T, E > & | init_cost_sensitive_learner (free_ptr< T > &dat, L *base, void(*learn)(T &, L &, E &), void(*predict)(T &, L &, E &), parser *p, size_t ws, const std::string &name, prediction_type_t pred_type=prediction_type_t::multiclass, bool learn_returns_prediction=false) |
template<class T , class E > | |
base_learner * | make_base (learner< T, E > &base) |
template<class T , class E > | |
multi_learner * | as_multiline (learner< T, E > *l) |
template<class T , class E > | |
single_learner * | as_singleline (learner< T, E > *l) |
template<bool is_learn> | |
void | multiline_learn_or_predict (multi_learner &base, multi_ex &examples, const uint64_t offset, const uint32_t id=0) |
float | noop_sensitivity_base (void *, example &) |
template<class DataT , class ExampleT , class BaseLearnerT > | |
VW_WARNING_STATE_POP reduction_learner_builder< DataT, ExampleT, BaseLearnerT > | make_reduction_learner (std::unique_ptr< DataT > &&data, BaseLearnerT *base, void(*learn_fn)(DataT &, BaseLearnerT &, ExampleT &), void(*predict_fn)(DataT &, BaseLearnerT &, ExampleT &), const std::string &name) |
template<class ExampleT , class BaseLearnerT > | |
reduction_no_data_learner_builder< ExampleT, BaseLearnerT > | make_no_data_reduction_learner (BaseLearnerT *base, void(*learn_fn)(char &, BaseLearnerT &, ExampleT &), void(*predict_fn)(char &, BaseLearnerT &, ExampleT &), const std::string &name) |
template<class DataT , class ExampleT > | |
base_learner_builder< DataT, ExampleT > | make_base_learner (std::unique_ptr< DataT > &&data, void(*learn_fn)(DataT &, base_learner &, ExampleT &), void(*predict_fn)(DataT &, base_learner &, ExampleT &), const std::string &name, prediction_type_t pred_type, label_type_t label_type) |
Contains the VW::LEARNER::learner object and utilities for interacting with it.
typedef learner< char, char > VW::LEARNER::base_learner |
Used to type erase the object and pass around common type.
typedef learner< char, multi_ex > VW::LEARNER::multi_learner |
Used for multiline examples where there are several example objects required to describe the overall example. It type erases the specific reduction object type.
typedef learner< char, example > VW::LEARNER::single_learner |
Used for reductions that process single example objects at at time. It type erases the specific reduction object type.
multi_learner* VW::LEARNER::as_multiline | ( | learner< T, E > * | l | ) |
single_learner* VW::LEARNER::as_singleline | ( | learner< T, E > * | l | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void VW::LEARNER::generic_driver | ( | vw & | all | ) |
void VW::LEARNER::generic_driver | ( | const std::vector< vw * > & | alls | ) |
void VW::LEARNER::generic_driver_onethread | ( | vw & | all | ) |
|
inline |
learner<T, E>& VW::LEARNER::init_cost_sensitive_learner | ( | free_ptr< T > & | dat, |
L * | base, | ||
void(*)(T &, L &, E &) | learn, | ||
void(*)(T &, L &, E &) | predict, | ||
parser * | p, | ||
size_t | ws, | ||
const std::string & | name, | ||
prediction_type_t | pred_type = prediction_type_t::multiclass , |
||
bool | learn_returns_prediction = false |
||
) |
learner<T, E>& VW::LEARNER::init_learner | ( | free_ptr< T > & | dat, |
L * | base, | ||
void(*)(T &, L &, E &) | learn, | ||
void(*)(T &, L &, E &) | predict, | ||
size_t | ws, | ||
prediction_type_t | pred_type, | ||
const std::string & | name, | ||
bool | learn_returns_prediction = false |
||
) |
learner<T, E>& VW::LEARNER::init_learner | ( | free_ptr< T > & | dat, |
void(*)(T &, L &, E &) | learn, | ||
void(*)(T &, L &, E &) | predict, | ||
size_t | params_per_weight, | ||
const std::string & | name, | ||
bool | learn_returns_prediction = false |
||
) |
learner<T, E>& VW::LEARNER::init_learner | ( | void(*)(T &, L &, E &) | predict, |
size_t | params_per_weight, | ||
const std::string & | name | ||
) |
learner<T, E>& VW::LEARNER::init_learner | ( | free_ptr< T > & | dat, |
void(*)(T &, L &, E &) | learn, | ||
void(*)(T &, L &, E &) | predict, | ||
size_t | params_per_weight, | ||
prediction_type_t | pred_type, | ||
const std::string & | name, | ||
bool | learn_returns_prediction = false |
||
) |
learner<T, E>& VW::LEARNER::init_learner | ( | free_ptr< T > & | dat, |
L * | base, | ||
void(*)(T &, L &, E &) | learn, | ||
void(*)(T &, L &, E &) | predict, | ||
size_t | ws, | ||
const std::string & | name, | ||
bool | learn_returns_prediction = false |
||
) |
learner<T, E>& VW::LEARNER::init_learner | ( | free_ptr< T > & | dat, |
L * | base, | ||
void(*)(T &, L &, E &) | learn, | ||
void(*)(T &, L &, E &) | predict, | ||
const std::string & | name, | ||
bool | learn_returns_prediction = false |
||
) |
learner<T, E>& VW::LEARNER::init_learner | ( | L * | base, |
void(*)(T &, L &, E &) | learn, | ||
void(*)(T &, L &, E &) | predict, | ||
const std::string & | name, | ||
bool | learn_returns_prediction = false |
||
) |
learner<T, E>& VW::LEARNER::init_multiclass_learner | ( | free_ptr< T > & | dat, |
L * | base, | ||
void(*)(T &, L &, E &) | learn, | ||
void(*)(T &, L &, E &) | predict, | ||
parser * | p, | ||
size_t | ws, | ||
const std::string & | name, | ||
prediction_type_t | pred_type = prediction_type_t::multiclass , |
||
bool | learn_returns_prediction = false |
||
) |
base_learner* VW::LEARNER::make_base | ( | learner< T, E > & | base | ) |
base_learner_builder<DataT, ExampleT> VW::LEARNER::make_base_learner | ( | std::unique_ptr< DataT > && | data, |
void(*)(DataT &, base_learner &, ExampleT &) | learn_fn, | ||
void(*)(DataT &, base_learner &, ExampleT &) | predict_fn, | ||
const std::string & | name, | ||
prediction_type_t | pred_type, | ||
label_type_t | label_type | ||
) |
reduction_no_data_learner_builder<ExampleT, BaseLearnerT> VW::LEARNER::make_no_data_reduction_learner | ( | BaseLearnerT * | base, |
void(*)(char &, BaseLearnerT &, ExampleT &) | learn_fn, | ||
void(*)(char &, BaseLearnerT &, ExampleT &) | predict_fn, | ||
const std::string & | name | ||
) |
VW_WARNING_STATE_POP reduction_learner_builder<DataT, ExampleT, BaseLearnerT> VW::LEARNER::make_reduction_learner | ( | std::unique_ptr< DataT > && | data, |
BaseLearnerT * | base, | ||
void(*)(DataT &, BaseLearnerT &, ExampleT &) | learn_fn, | ||
void(*)(DataT &, BaseLearnerT &, ExampleT &) | predict_fn, | ||
const std::string & | name | ||
) |
void VW::LEARNER::multiline_learn_or_predict | ( | multi_learner & | base, |
multi_ex & | examples, | ||
const uint64_t | offset, | ||
const uint32_t | id = 0 |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
float VW::LEARNER::recur_sensitivity | ( | void * | , |
base_learner & | , | ||
example & | |||
) |
|
inline |