Vowpal Wabbit
|
Namespaces | |
namespace | cb_continuous |
namespace | cb_explore_adf |
namespace | cb_graph_feedback |
namespace | config |
namespace | continuous_actions |
namespace | debug |
namespace | details |
namespace | estimators |
namespace | experimental |
namespace | explore |
namespace | io |
namespace | known_alignments |
namespace | large_action_space |
namespace | LEARNER |
Contains the VW::LEARNER::learner object and utilities for interacting with it. | |
namespace | math |
namespace | model_utils |
namespace | parsers |
namespace | reductions |
namespace | slates |
namespace | version_definitions |
Typedefs | |
using | string_view = nonstd::string_view |
using | action_scores = VW::v_array< action_score > |
using | weight = float |
using | multi_ex = std::vector< example * > |
using | decision_scores_t = std::vector< VW::action_scores > |
using | trace_message_t = void(*)(void *, const std::string &) |
using | example_factory_t = std::function< example &()> |
using | namespace_index = unsigned char |
using | feature_value = float |
using | feature_index = uint64_t |
using | extent_term = std::pair< namespace_index, uint64_t > |
using | options_deleter_type = void(*)(VW::config::options_i *) |
using | hash_func_t = uint32_t(*)(const char *, size_t, uint32_t) |
template<typename T > | |
using | generate_func_t = std::vector< std::vector< T > >(const std::set< T > &namespaces, size_t num_to_pick) |
template<typename DataT , typename ExampleT > | |
using | learner_update_stats_func = void(const VW::workspace &all, shared_data &sd, const DataT &, const ExampleT &, VW::io::logger &logger) |
template<typename DataT , typename ExampleT > | |
using | learner_output_example_prediction_func = void(VW::workspace &all, const DataT &, const ExampleT &, VW::io::logger &logger) |
template<typename DataT , typename ExampleT > | |
using | learner_print_update_func = void(VW::workspace &all, shared_data &, const DataT &, const ExampleT &, VW::io::logger &logger) |
template<typename DataT , typename ExampleT > | |
using | learner_cleanup_example_func = void(DataT &, ExampleT &) |
template<typename T , typename TInitializer = details::default_factory<T>> | |
using | no_lock_object_pool = details::object_pool_impl< T, details::null_mutex, TInitializer > |
template<typename T , typename TInitializer = details::default_factory<T>> | |
using | object_pool = details::object_pool_impl< T, std::mutex, TInitializer > |
using | reduction_setup_fn = std::shared_ptr< VW::LEARNER::learner >(*)(VW::setup_base_i &) |
template<typename T > | |
using | v_array_pool = VW::moved_object_pool< v_array< T > > |
template<typename T > | |
using | vector_pool = VW::moved_object_pool< std::vector< T > > |
using | driver_output_func_t = VW::trace_message_t |
using | example_sink_f = std::function< void(VW::multi_ex &&spare_examples)> |
using | SpanningTree = spanning_tree |
Enumerations | |
enum class | all_reduce_type { SOCKET , THREAD } |
enum class | cb_type_t : uint32_t { DR , DM , IPS , MTR , SM } |
enum class | ccb_example_type : uint8_t { UNSET = 0 , SHARED = 1 , ACTION = 2 , SLOT = 3 } |
enum class | label_type_t : uint32_t { SIMPLE , CB , CB_EVAL , CB_WITH_OBSERVATIONS , CS , MULTILABEL , MULTICLASS , CCB , SLATES , NOLABEL , CONTINUOUS , simple = SIMPLE , cb = CB , cb_eval = CB_EVAL , cs = CS , multilabel = MULTILABEL , multiclass = MULTICLASS , ccb = CCB , slates = SLATES , nolabel = NOLABEL , continuous = CONTINUOUS } |
enum class | prediction_type_t : uint32_t { SCALAR , SCALARS , ACTION_SCORES , PDF , ACTION_PROBS , MULTICLASS , MULTILABELS , PROB , MULTICLASS_PROBS , DECISION_PROBS , ACTION_PDF_VALUE , ACTIVE_MULTICLASS , NOPRED , scalar = SCALAR , scalars = SCALARS , action_scores = ACTION_SCORES , pdf = PDF , action_probs = ACTION_PROBS , multiclass = MULTICLASS , multilabels = MULTILABELS , prob = PROB , multiclassprobs = MULTICLASS_PROBS , decision_probs = DECISION_PROBS , action_pdf_value = ACTION_PDF_VALUE , active_multiclass = ACTIVE_MULTICLASS , nopred = NOPRED } |
enum class | wrap_type { truncate , truncate_with_ellipsis , wrap_space , wrap_char } |
enum class | align_type { left , right } |
Functions | |
VW_STD14_CONSTEXPR uint32_t | uniform_hash (const char *data, size_t len, uint32_t seed) |
template<typename ContainerT > | |
void | tokenize (char delim, VW::string_view s, ContainerT &ret, bool allow_empty=false) |
bool | ends_with (VW::string_view full_string, VW::string_view ending) |
Check if a string ends with some other string. More... | |
bool | starts_with (VW::string_view full_string, VW::string_view starting) |
Check if a string starts with some other string. More... | |
std::string | wrap_text (VW::string_view text, size_t width, bool wrap_after=true) |
Wrap text by whole words with the given column width. More... | |
constexpr bool | operator< (const action_score &left, const action_score &right) |
constexpr bool | operator> (const action_score &left, const action_score &right) |
std::ostream & | operator<< (std::ostream &os, const action_score &a_s) |
std::string | to_string (const action_scores &action_scores_or_probs, int decimal_precision=details::DEFAULT_FLOAT_PRECISION) |
action_scores_score_iterator | begin_scores (action_scores &a_s) |
action_scores_score_iterator | end_scores (action_scores &a_s) |
std::string | to_string (const VW::active_multiclass_prediction &active_multiclass) |
VW::string_view | to_string (reductions::automl::automl_state state) |
VW::string_view | to_string (reductions::automl::config_state state) |
VW::string_view | to_string (reductions::automl::config_type state) |
void | count_label (shared_data &sd, float l) |
bool | get_best_constant (const loss_function &loss_func, const shared_data &sd, float &best_constant, float &best_constant_loss) |
void | write_example_to_cache (io_buf &output, VW::example *ex_ptr, VW::label_parser &lbl_parser, uint64_t parse_mask, VW::parsers::cache::details::cache_temp_buffer &temp_buffer) |
int | read_example_from_cache (VW::workspace *all, io_buf &input, VW::multi_ex &examples) |
bool | ec_is_example_header_cb (VW::example const &ec) |
std::pair< bool, cb_class > | get_observed_cost_cb (const cb_label &ld) |
std::string | to_string (const cb_continuous::continuous_label_elm &elm, int decimal_precision=details::DEFAULT_FLOAT_PRECISION) |
std::string | to_string (const cb_continuous::continuous_label &lbl, int decimal_precision=details::DEFAULT_FLOAT_PRECISION) |
cb_type_t | cb_type_from_string (string_view str) |
string_view | to_string (cb_type_t type) |
bool | ec_is_example_header_cb_with_observations (VW::example const &ec) |
void | parse_ccb_label (ccb_label &ld, VW::label_parser_reuse_mem &reuse_mem, const std::vector< VW::string_view > &words, VW::io::logger &logger) |
const char * | to_string (ccb_example_type type) |
bool | is_cs_example_header (const VW::example &ec) |
int | string_cpy (char *dest, size_t dest_size, const char *src) |
int | file_open (FILE **pf, const char *filename, const char *mode) |
int | get_pid () |
void | print_decision_scores (VW::io::writer *f, const VW::decision_scores_t &decision_scores, VW::io::logger &logger) |
std::string | to_string (const VW::decision_scores_t &decision_scores, int decimal_precision=VW::details::DEFAULT_FLOAT_PRECISION) |
void | print_update_ccb (VW::workspace &all, const std::vector< example * > &slots, const VW::decision_scores_t &decision_scores, size_t num_features) |
void | print_update_slates (VW::workspace &all, const std::vector< example * > &slots, const VW::decision_scores_t &decision_scores, size_t num_features) |
void | copy_example_data (example *dst, const example *src) |
void | setup_example (VW::workspace &all, example *ae) |
std::string | to_string (const v_array< float > &scalars, int decimal_precision=details::DEFAULT_FLOAT_PRECISION) |
void | swap_prediction (polyprediction &a, polyprediction &b, prediction_type_t prediction_type) |
void | flatten_features (VW::workspace &all, example &ec, features &fs) |
bool | example_is_newline (const example &ec) |
bool | valid_ns (char c) |
void | return_multiple_example (VW::workspace &all, VW::multi_ex &examples) |
VW_STD14_CONSTEXPR float | fast_pow10 (int8_t exponent) |
std::string | to_string (const audit_strings &ai) |
float | features_dot_product (const features &fs1, const features &fs2) |
template<class DataT , void(*)(DataT &, float feature_value, uint64_t feature_index) FuncT, class WeightsT > | |
void | foreach_feature (WeightsT &, const VW::features &fs, DataT &dat, uint64_t offset=0, float mult=1.) |
template<class DataT , void(*)(DataT &, float, float) FuncT, class WeightsT > | |
void | foreach_feature (const WeightsT &weights, const VW::features &fs, DataT &dat, uint64_t offset=0, float mult=1.) |
template<class DataT , class WeightOrIndexT , void(*)(DataT &, float, WeightOrIndexT) FuncT, class WeightsT > | |
void | generate_interactions (const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, bool permutations, VW::example_predict &ec, DataT &dat, WeightsT &weights, size_t &num_interacted_features, VW::details::generate_interactions_object_cache &cache) |
template<class DataT , class WeightOrIndexT , void(*)(DataT &, float, WeightOrIndexT) FuncT, class WeightsT > | |
void | foreach_feature (WeightsT &weights, bool ignore_some_linear, std::array< bool, VW::NUM_NAMESPACES > &ignore_linear, const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, bool permutations, VW::example_predict &ec, DataT &dat, size_t &num_interacted_features, VW::details::generate_interactions_object_cache &cache) |
template<class DataT , class WeightOrIndexT , void(*)(DataT &, float, WeightOrIndexT) FuncT, class WeightsT > | |
void | foreach_feature (WeightsT &weights, bool ignore_some_linear, std::array< bool, VW::NUM_NAMESPACES > &ignore_linear, const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, bool permutations, VW::example_predict &ec, DataT &dat, VW::details::generate_interactions_object_cache &cache) |
template<class WeightsT > | |
float | inline_predict (WeightsT &weights, bool ignore_some_linear, std::array< bool, VW::NUM_NAMESPACES > &ignore_linear, const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, bool permutations, VW::example_predict &ec, VW::details::generate_interactions_object_cache &cache, float initial=0.f) |
template<class WeightsT > | |
float | inline_predict (WeightsT &weights, bool ignore_some_linear, std::array< bool, VW::NUM_NAMESPACES > &ignore_linear, const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, bool permutations, VW::example_predict &ec, size_t &num_interacted_features, VW::details::generate_interactions_object_cache &cache, float initial=0.f) |
template<typename T > | |
details::swap_guard_impl< T > | swap_guard (T &original_location, T &value_to_swap) noexcept |
template<typename T > | |
details::swap_guard_impl_rvalue< T > | swap_guard (T &original_location, T &&value_to_swap) noexcept |
template<typename T > | |
details::swap_guard_impl_rvalue< T > | stash_guard (T &original_location) noexcept |
hash_func_t | get_hasher (const std::string &s) |
constexpr bool | is_interaction_ns (const unsigned char ns) |
bool | contains_wildcard (const std::vector< VW::namespace_index > &interaction) |
bool | contains_wildcard (const std::vector< VW::extent_term > &interaction) |
float | eval_sum_ft_squared_of_generated_ft (bool permutations, const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, const std::array< VW::features, VW::NUM_NAMESPACES > &feature_spaces) |
template<class DataT , class WeightOrIndexT , void(*)(DataT &, float, WeightOrIndexT) FuncT, bool audit, void(*)(DataT &, const VW::audit_strings *) audit_func, class WeightsT > | |
void | generate_interactions (const std::vector< std::vector< VW::namespace_index > > &interactions, const std::vector< std::vector< VW::extent_term > > &extent_interactions, bool permutations, VW::example_predict &ec, DataT &dat, WeightsT &weights, size_t &num_features, VW::details::generate_interactions_object_cache &cache) |
label_parser | get_label_parser (VW::label_type_t label_type) |
string_view | to_string (VW::label_type_t) |
std::unique_ptr< loss_function > | get_loss_function (VW::workspace &, const std::string &funcName, float function_parameter_0=-1.0f, float function_parameter_1=1.0f) |
template<typename T , typename... Args> | |
std::unique_ptr< T > | make_unique (Args &&... params) |
std::unique_ptr< VW::workspace > | merge_models (const VW::workspace *base_workspace, const std::vector< const VW::workspace * > &workspaces_to_merge, VW::io::logger *logger=nullptr) |
VW::model_delta | merge_deltas (const std::vector< const VW::model_delta * > &deltas_to_merge, VW::io::logger *logger=nullptr) |
std::unique_ptr< VW::workspace > | operator+ (const VW::workspace &ws, const VW::model_delta &md) |
VW::model_delta | operator- (const VW::workspace &ws1, const VW::workspace &ws2) |
bool | test_multiclass_label (const multiclass_label &ld) |
std::string | to_string (const VW::multilabel_label &multilabels) |
std::string | to_string (const VW::multilabel_prediction &multilabels) |
template<typename RetType , typename InputType > | |
RetType | cast_to_smaller_type (InputType input) |
template<typename RetType , typename InputType > | |
RetType | cast_signed_to_unsigned (InputType input) |
template<typename RetType , typename InputType > | |
RetType | cast_unsigned_to_signed (InputType input) |
void | read_line (VW::workspace &all, example *ex, VW::string_view line) |
void | read_line (VW::workspace &all, example *ex, const char *line) |
void | read_lines (VW::workspace *all, const char *line, size_t len, VW::multi_ex &examples) |
void | read_lines (VW::workspace *all, VW::string_view lines, VW::multi_ex &examples) |
template<bool audit> | |
void | read_line_json_s (const VW::label_parser &lbl_parser, hash_func_t hash_func, uint64_t hash_seed, uint64_t parse_mask, bool chain_hash, VW::label_parser_reuse_mem *reuse_mem, const VW::named_labels *ldict, VW::multi_ex &examples, char *line, size_t length, example_factory_t example_factory, VW::io::logger &logger, std::unordered_map< std::string, std::set< std::string > > *ignore_features, const std::unordered_map< uint64_t, VW::example * > *dedup_examples=nullptr) |
template<bool audit> | |
void | read_line_json_s (VW::workspace &all, VW::multi_ex &examples, char *line, size_t length, example_factory_t example_factory, const std::unordered_map< uint64_t, VW::example * > *dedup_examples=nullptr) |
template<bool audit> | |
bool | read_line_decision_service_json (VW::workspace &all, VW::multi_ex &examples, char *line, size_t length, bool copy_line, example_factory_t example_factory, VW::parsers::json::decision_service_interaction *data) |
std::string | trim_whitespace (const std::string &s) |
Trim whitespace from the beginning and end of a string. More... | |
VW::string_view | trim_whitespace (VW::string_view str) |
Trim whitespace from the beginning and end of a string. More... | |
std::vector< std::string > | split_command_line (const std::string &cmd_line) |
Split a string like a shell splits a command line. This function handles quotes and escapes. More... | |
std::vector< std::string > | split_command_line (VW::string_view cmd_line) |
Split a string like a shell splits a command line. This function handles quotes and escapes. More... | |
std::vector< VW::string_view > | split_by_limit (const VW::string_view &s, size_t limit) |
void | parse_example_label (string_view label, const VW::label_parser &lbl_parser, const named_labels *ldict, label_parser_reuse_mem &reuse_mem, example &ec, VW::io::logger &logger) |
void | setup_examples (VW::workspace &all, VW::multi_ex &examples) |
VW::example & | get_unused_example (VW::workspace *all) |
string_view | to_string (prediction_type_t) |
std::string | to_string (const continuous_actions::probability_density_function_value &pdf_value, int decimal_precision=details::DEFAULT_FLOAT_PRECISION) |
std::string | to_string (const continuous_actions::probability_density_function &pdf, int decimal_precision=details::DEFAULT_FLOAT_PRECISION) |
template<> | |
VW::ccb_reduction_features & | reduction_features::get< VW::ccb_reduction_features > () |
template<> | |
const VW::ccb_reduction_features & | reduction_features::get< VW::ccb_reduction_features > () const |
template<> | |
VW::continuous_actions::reduction_features & | reduction_features::get< VW::continuous_actions::reduction_features > () |
template<> | |
const VW::continuous_actions::reduction_features & | reduction_features::get< VW::continuous_actions::reduction_features > () const |
template<> | |
simple_label_reduction_features & | reduction_features::get< VW::simple_label_reduction_features > () |
template<> | |
const simple_label_reduction_features & | reduction_features::get< VW::simple_label_reduction_features > () const |
template<> | |
VW::cb_explore_adf::greedy::reduction_features & | reduction_features::get< VW::cb_explore_adf::greedy::reduction_features > () |
template<> | |
const VW::cb_explore_adf::greedy::reduction_features & | reduction_features::get< VW::cb_explore_adf::greedy::reduction_features > () const |
template<> | |
VW::large_action_space::las_reduction_features & | reduction_features::get< VW::large_action_space::las_reduction_features > () |
template<> | |
const VW::large_action_space::las_reduction_features & | reduction_features::get< VW::large_action_space::las_reduction_features > () const |
template<> | |
VW::cb_graph_feedback::reduction_features & | reduction_features::get< VW::cb_graph_feedback::reduction_features > () |
template<> | |
const VW::cb_graph_feedback::reduction_features & | reduction_features::get< VW::cb_graph_feedback::reduction_features > () const |
VW::example * | test_cb_adf_sequence (const VW::multi_ex &ec_seq, bool allow_multiple_costs=false) |
VW::cb_class | get_observed_cost_or_default_cb_adf (const VW::multi_ex &examples) |
template<bool is_learn> | |
float | get_cost_pred (VW::LEARNER::learner *scorer, const VW::cb_class &known_cost, VW::example &ec, uint32_t index, uint32_t base) |
float | get_cost_estimate (const VW::cb_class &observation, uint32_t action, float offset=0.) |
float | get_cost_estimate (const VW::cb_class &observation, const VW::cs_label &scores, uint32_t action) |
float | get_cost_estimate (const VW::cb_label &ld, uint32_t action) |
float | get_cost_estimate (const VW::action_score &a_s, float cost, uint32_t action, float offset=0.) |
bool | example_is_newline_not_header_cb (VW::example const &ec) |
template<class DataT , class WeightOrIndexT , void(*)(DataT &, float, WeightOrIndexT) FuncT> | |
void | foreach_feature (VW::workspace &all, VW::example &ec, DataT &dat) |
template<class DataT , class WeightOrIndexT , void(*)(DataT &, float, WeightOrIndexT) FuncT> | |
void | foreach_feature (VW::workspace &all, VW::example &ec, DataT &dat, size_t &num_interacted_features) |
template<class DataT , void(*)(DataT &, float, float &) FuncT> | |
void | foreach_feature (VW::workspace &all, VW::example &ec, DataT &dat) |
template<class DataT , void(*)(DataT &, float, float &) FuncT> | |
void | foreach_feature (VW::workspace &all, VW::example &ec, DataT &dat, size_t &num_interacted_features) |
float | inline_predict (VW::workspace &all, VW::example &ec) |
float | inline_predict (VW::workspace &all, VW::example &ec, size_t &num_generated_features) |
float | trunc_weight (const float w, const float gravity) |
template<class R , class S , void(*)(R &, float, S) T, bool audit, void(*)(R &, const VW::audit_strings *) audit_func> | |
void | generate_interactions (VW::workspace &all, VW::example_predict &ec, R &dat, size_t &num_interacted_features) |
template<class R , class S , void(*)(R &, float, S) T> | |
void | generate_interactions (VW::workspace &all, VW::example_predict &ec, R &dat, size_t &num_interacted_features) |
template<typename TScopeExitLambda > | |
details::scope_exit_caller< TScopeExitLambda > | scope_exit (TScopeExitLambda &&lambda) noexcept |
bool | operator== (const simple_label &lhs, const simple_label &rhs) |
bool | operator!= (const simple_label &lhs, const simple_label &rhs) |
VW::string_view | to_string (VW::slates::example_type) |
template<size_t num_cols> | |
void | format_row (const std::array< std::string, num_cols > &contents, const std::array< column_definition, num_cols > &column_definitions, size_t column_padding, std::ostream &output) |
template<size_t num_cols> | |
std::string | format_row (const std::array< std::string, num_cols > &contents, const std::array< column_definition, num_cols > &column_definitions, size_t column_padding) |
bool | try_extract_random_seed (const VW::example &ex, VW::string_view &view) |
std::string | decode_inline_hex (VW::string_view arg, VW::io::logger &logger) |
Replace hex sequences in a string with their corresponding byte. A hex sequence must only contain two digits and must be in the form \x00. More... | |
std::string | fmt_float (float f, int max_decimal_places) |
Format float to string with max number of digits after the decimal place. More... | |
void | unique_features (features &fs, int max=-1) |
Remove all non unique features from a feature group. More... | |
void | unique_sort_features (uint64_t parse_mask, VW::example &ae) |
constexpr version_struct | VERSION (VW_VERSION_MAJOR, VW_VERSION_MINOR, VW_VERSION_PATCH) |
constexpr version_struct | version (VW_VERSION_MAJOR, VW_VERSION_MINOR, VW_VERSION_PATCH) |
VW::workspace * | initialize (std::unique_ptr< config::options_i, options_deleter_type > options, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr) |
VW::workspace * | initialize (config::options_i &options, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr) |
VW::workspace * | initialize (const std::string &s, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr) |
VW::workspace * | initialize (int argc, char *argv[], io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr) |
VW::workspace * | seed_vw_model (VW::workspace *vw_model, const std::string &extra_args, trace_message_t trace_listener=nullptr, void *trace_context=nullptr) |
VW::workspace * | initialize_escaped (std::string const &s, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr) |
VW::workspace * | initialize_with_builder (const std::string &s, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr, std::unique_ptr< VW::setup_base_i >=nullptr) |
std::unique_ptr< VW::workspace > | initialize (std::unique_ptr< config::options_i > options, std::unique_ptr< VW::io::reader > model_override_reader=nullptr, driver_output_func_t driver_output_func=nullptr, void *driver_output_func_context=nullptr, VW::io::logger *custom_logger=nullptr) |
Initialize a workspace. More... | |
std::unique_ptr< VW::workspace > | seed_vw_model (VW::workspace &vw_model, const std::vector< std::string > &extra_args, driver_output_func_t driver_output_func=nullptr, void *driver_output_func_context=nullptr, VW::io::logger *custom_logger=nullptr) |
std::unique_ptr< VW::workspace > | initialize_experimental (std::unique_ptr< config::options_i > options, std::unique_ptr< VW::io::reader > model_override_reader=nullptr, driver_output_func_t driver_output_func=nullptr, void *driver_output_func_context=nullptr, VW::io::logger *custom_logger=nullptr, std::unique_ptr< VW::setup_base_i > setup_base=nullptr) |
Initialize a workspace. This interface is currently experimental, but will replace the existing array of initialize functions. More... | |
void | cmd_string_replace_value (std::stringstream *&ss, std::string flag_to_replace, const std::string &new_value) |
char ** | to_argv (std::string const &s, int &argc) |
char ** | to_argv_escaped (std::string const &s, int &argc) |
void | free_args (int argc, char *argv[]) |
const char * | are_features_compatible (const VW::workspace &vw1, const VW::workspace &vw2) |
void | finish (VW::workspace &all, bool delete_all=true) |
Call finish() after you are done with the vw instance. This cleans up memory usage if delete_all is true. Finish will cause final stat printouts and model serialization to occur. IMPORTANT: If lifetime is managed by a unique_ptr from initialize_experimental, then you must call this with delete_all = false. More... | |
void | sync_stats (VW::workspace &all) |
void | start_parser (VW::workspace &all) |
void | end_parser (VW::workspace &all) |
bool | is_ring_example (const VW::workspace &all, const example *ae) |
example * | read_example (VW::workspace &all, const char *example_line) |
example * | read_example (VW::workspace &all, const std::string &example_line) |
example * | import_example (VW::workspace &all, const std::string &label, primitive_feature_space *features, size_t len) |
example * | alloc_examples (size_t count) |
void | dealloc_examples (example *example_ptr, size_t count) |
void | parse_example_label (VW::workspace &all, example &ec, const std::string &label) |
example * | new_unused_example (VW::workspace &all) |
example * | get_example (parser *pf) |
float | get_topic_prediction (example *ec, size_t i) |
float | get_label (example *ec) |
float | get_importance (example *ec) |
float | get_initial (example *ec) |
float | get_prediction (example *ec) |
float | get_cost_sensitive_prediction (example *ec) |
v_array< float > & | get_cost_sensitive_prediction_confidence_scores (example *ec) |
uint32_t * | get_multilabel_predictions (example *ec, size_t &len) |
float | get_action_score (example *ec, size_t i) |
size_t | get_action_score_length (example *ec) |
size_t | get_tag_length (example *ec) |
const char * | get_tag (example *ec) |
size_t | get_feature_number (example *ec) |
float | get_confidence (example *ec) |
feature * | get_features (VW::workspace &all, example *ec, size_t &feature_number) |
void | return_features (feature *f) |
void | add_constant_feature (const VW::workspace &all, example *ec) |
void | add_label (example *ec, float label, float weight=1, float base=0) |
void | finish_example (VW::workspace &all, example &ec) |
void | finish_example (VW::workspace &all, multi_ex &ec) |
void | empty_example (VW::workspace &all, example &ec) |
void | move_feature_namespace (example *dst, example *src, namespace_index c) |
void | copy_example_metadata (example *, const example *) |
void | copy_example_data_with_label (example *dst, const example *src) |
primitive_feature_space * | export_example (VW::workspace &all, example *e, size_t &len) |
void | release_feature_space (primitive_feature_space *features, size_t len) |
void | releaseFeatureSpace (primitive_feature_space *features, size_t len) |
void | save_predictor (VW::workspace &all, const std::string ®_name) |
void | save_predictor (VW::workspace &all, io_buf &buf) |
uint64_t | hash_space (VW::workspace &all, const std::string &s) |
uint64_t | hash_space_static (const std::string &s, const std::string &hash) |
uint64_t | hash_space_cstr (VW::workspace &all, const char *fstr) |
uint64_t | hash_feature (VW::workspace &all, const std::string &s, uint64_t u) |
uint64_t | hash_feature_static (const std::string &s, uint64_t u, const std::string &h, uint32_t num_bits) |
uint64_t | hash_feature_cstr (VW::workspace &all, const char *fstr, uint64_t u) |
uint64_t | chain_hash (VW::workspace &all, const std::string &name, const std::string &value, uint64_t u) |
uint64_t | chain_hash_static (const std::string &name, const std::string &value, uint64_t u, hash_func_t hash_func, uint64_t parse_mask) |
float | get_weight (VW::workspace &all, uint32_t index, uint32_t offset) |
void | set_weight (VW::workspace &all, uint32_t index, uint32_t offset, float value) |
uint32_t | num_weights (VW::workspace &all) |
uint32_t | get_stride (VW::workspace &all) |
void | init_features (primitive_feature_space &fs, size_t features_count) |
void | set_feature (primitive_feature_space &fs, size_t index, uint64_t feature_hash, float value) |
void | validate_version (VW::workspace &all) |
void | validate_min_max_label (VW::workspace &all) |
void | validate_default_bits (VW::workspace &all, uint32_t local_num_bits) |
void | validate_num_bits (VW::workspace &all) |
Variables | |
VW::label_parser | cb_label_parser_global |
VW::label_parser | cb_eval_label_parser_global |
VW::label_parser | cb_with_observations_global |
VW::label_parser | ccb_label_parser_global |
constexpr size_t | NUM_NAMESPACES = 256 |
VW::label_parser | cs_label_parser_global |
VW::label_parser | multiclass_label_parser_global |
VW::label_parser | multilabel_label_parser_global |
VW::label_parser | no_label_parser_global |
VW::label_parser | simple_label_parser_global |
const std::string | GIT_COMMIT |
const std::string | git_commit |
const std::string | ENABLED_FEATURES |
using VW::action_scores = typedef VW::v_array<action_score> |
using VW::decision_scores_t = typedef std::vector<VW::action_scores> |
using VW::driver_output_func_t = typedef VW::trace_message_t |
using VW::example_factory_t = typedef std::function<example&()> |
using VW::example_sink_f = typedef std::function<void(VW::multi_ex&& spare_examples)> |
using VW::extent_term = typedef std::pair<namespace_index, uint64_t> |
using VW::feature_index = typedef uint64_t |
using VW::feature_value = typedef float |
using VW::generate_func_t = typedef std::vector<std::vector<T> >(const std::set<T>& namespaces, size_t num_to_pick) |
using VW::hash_func_t = typedef uint32_t (*)(const char*, size_t, uint32_t) |
using VW::learner_cleanup_example_func = typedef void(DataT&, ExampleT&) |
using VW::learner_output_example_prediction_func = typedef void( VW::workspace& all, const DataT&, const ExampleT&, VW::io::logger& logger) |
using VW::learner_print_update_func = typedef void( VW::workspace& all, shared_data&, const DataT&, const ExampleT&, VW::io::logger& logger) |
using VW::learner_update_stats_func = typedef void( const VW::workspace& all, shared_data& sd, const DataT&, const ExampleT&, VW::io::logger& logger) |
typedef std::vector< VW::example * > VW::multi_ex |
typedef unsigned char VW::namespace_index |
using VW::no_lock_object_pool = typedef details::object_pool_impl<T, details::null_mutex, TInitializer> |
using VW::object_pool = typedef details::object_pool_impl<T, std::mutex, TInitializer> |
using VW::options_deleter_type = typedef void (*)(VW::config::options_i*) |
using VW::reduction_setup_fn = typedef std::shared_ptr<VW::LEARNER::learner> (*)(VW::setup_base_i&) |
using VW::SpanningTree = typedef spanning_tree |
using VW::string_view = typedef nonstd::string_view |
using VW::trace_message_t = typedef void (*)(void*, const std::string&) |
using VW::v_array_pool = typedef VW::moved_object_pool<v_array<T> > |
using VW::vector_pool = typedef VW::moved_object_pool<std::vector<T> > |
using VW::weight = typedef float |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Enumerator | |
---|---|
SIMPLE | |
CB | |
CB_EVAL | |
CB_WITH_OBSERVATIONS | |
CS | |
MULTILABEL | |
MULTICLASS | |
CCB | |
SLATES | |
NOLABEL | |
CONTINUOUS | |
simple |
|
cb |
|
cb_eval |
|
cs |
|
multilabel |
|
multiclass |
|
ccb |
|
slates |
|
nolabel |
|
continuous |
|
|
strong |
Enumerator | |
---|---|
SCALAR | |
SCALARS | |
ACTION_SCORES | |
ACTION_PROBS | |
MULTICLASS | |
MULTILABELS | |
PROB | |
MULTICLASS_PROBS | |
DECISION_PROBS | |
ACTION_PDF_VALUE | |
ACTIVE_MULTICLASS | |
NOPRED | |
scalar |
|
scalars |
|
action_scores |
|
| |
action_probs |
|
multiclass |
|
multilabels |
|
prob |
|
multiclassprobs |
|
decision_probs |
|
action_pdf_value |
|
active_multiclass |
|
nopred |
|
|
strong |
void VW::add_constant_feature | ( | const VW::workspace & | all, |
example * | ec | ||
) |
void VW::add_label | ( | example * | ec, |
float | label, | ||
float | weight = 1 , |
||
float | base = 0 |
||
) |
example * VW::alloc_examples | ( | size_t | count | ) |
const char * VW::are_features_compatible | ( | const VW::workspace & | vw1, |
const VW::workspace & | vw2 | ||
) |
|
inline |
RetType VW::cast_signed_to_unsigned | ( | InputType | input | ) |
RetType VW::cast_to_smaller_type | ( | InputType | input | ) |
RetType VW::cast_unsigned_to_signed | ( | InputType | input | ) |
cb_type_t VW::cb_type_from_string | ( | string_view | str | ) |
|
inline |
|
inline |
void VW::cmd_string_replace_value | ( | std::stringstream *& | ss, |
std::string | flag_to_replace, | ||
const std::string & | new_value | ||
) |
|
inline |
|
inline |
|
inline |
void VW::dealloc_examples | ( | example * | example_ptr, |
size_t | count | ||
) |
std::string VW::decode_inline_hex | ( | VW::string_view | arg, |
VW::io::logger & | logger | ||
) |
Replace hex sequences in a string with their corresponding byte. A hex sequence must only contain two digits and must be in the form \x00.
arg | String to replace hex values within |
bool VW::ec_is_example_header_cb | ( | VW::example const & | ec | ) |
bool VW::ec_is_example_header_cb_with_observations | ( | VW::example const & | ec | ) |
void VW::empty_example | ( | VW::workspace & | all, |
example & | ec | ||
) |
void VW::end_parser | ( | VW::workspace & | all | ) |
|
inline |
|
inline |
Check if a string ends with some other string.
full_string | String to check ending of |
ending | Ending value to check |
float VW::eval_sum_ft_squared_of_generated_ft | ( | bool | permutations, |
const std::vector< std::vector< VW::namespace_index > > & | interactions, | ||
const std::vector< std::vector< VW::extent_term > > & | extent_interactions, | ||
const std::array< VW::features, VW::NUM_NAMESPACES > & | feature_spaces | ||
) |
|
inline |
|
inline |
primitive_feature_space * VW::export_example | ( | VW::workspace & | all, |
example * | e, | ||
size_t & | len | ||
) |
|
inline |
Both fs1 and fs2 must be sorted. Most often used with VW::flatten_features
int VW::file_open | ( | FILE ** | pf, |
const char * | filename, | ||
const char * | mode | ||
) |
void VW::finish | ( | VW::workspace & | all, |
bool | delete_all = true |
||
) |
Call finish() after you are done with the vw instance. This cleans up memory usage if delete_all is true. Finish will cause final stat printouts and model serialization to occur. IMPORTANT: If lifetime is managed by a unique_ptr from initialize_experimental, then you must call this with delete_all = false.
all | workspace to be finished |
delete_all | whethere to also also call delete on this instance. |
void VW::finish_example | ( | VW::workspace & | all, |
example & | ec | ||
) |
void VW::finish_example | ( | VW::workspace & | all, |
multi_ex & | ec | ||
) |
void VW::flatten_features | ( | VW::workspace & | all, |
example & | ec, | ||
features & | fs | ||
) |
std::string VW::fmt_float | ( | float | f, |
int | max_decimal_places | ||
) |
Format float to string with max number of digits after the decimal place.
f | float to format |
max_decimal_places | if >=0 the max number of digits after decimal place. If <0, then as many digits are needed to represent the number will be used |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::string VW::format_row | ( | const std::array< std::string, num_cols > & | contents, |
const std::array< column_definition, num_cols > & | column_definitions, | ||
size_t | column_padding | ||
) |
void VW::format_row | ( | const std::array< std::string, num_cols > & | contents, |
const std::array< column_definition, num_cols > & | column_definitions, | ||
size_t | column_padding, | ||
std::ostream & | output | ||
) |
void VW::free_args | ( | int | argc, |
char * | argv[] | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
float VW::get_action_score | ( | example * | ec, |
size_t | i | ||
) |
size_t VW::get_action_score_length | ( | example * | ec | ) |
bool VW::get_best_constant | ( | const loss_function & | loss_func, |
const shared_data & | sd, | ||
float & | best_constant, | ||
float & | best_constant_loss | ||
) |
float VW::get_confidence | ( | example * | ec | ) |
|
inline |
|
inline |
|
inline |
|
inline |
float VW::get_cost_pred | ( | VW::LEARNER::learner * | scorer, |
const VW::cb_class & | known_cost, | ||
VW::example & | ec, | ||
uint32_t | index, | ||
uint32_t | base | ||
) |
float VW::get_cost_sensitive_prediction | ( | example * | ec | ) |
size_t VW::get_feature_number | ( | example * | ec | ) |
feature * VW::get_features | ( | VW::workspace & | all, |
example * | ec, | ||
size_t & | feature_number | ||
) |
hash_func_t VW::get_hasher | ( | const std::string & | s | ) |
float VW::get_importance | ( | example * | ec | ) |
float VW::get_initial | ( | example * | ec | ) |
float VW::get_label | ( | example * | ec | ) |
label_parser VW::get_label_parser | ( | VW::label_type_t | label_type | ) |
std::unique_ptr< loss_function > VW::get_loss_function | ( | VW::workspace & | , |
const std::string & | funcName, | ||
float | function_parameter_0 = -1.0f , |
||
float | function_parameter_1 = 1.0f |
||
) |
uint32_t * VW::get_multilabel_predictions | ( | example * | ec, |
size_t & | len | ||
) |
VW::cb_class VW::get_observed_cost_or_default_cb_adf | ( | const VW::multi_ex & | examples | ) |
int VW::get_pid | ( | ) |
float VW::get_prediction | ( | example * | ec | ) |
|
inline |
const char * VW::get_tag | ( | example * | ec | ) |
size_t VW::get_tag_length | ( | example * | ec | ) |
float VW::get_topic_prediction | ( | example * | ec, |
size_t | i | ||
) |
VW::example & VW::get_unused_example | ( | VW::workspace * | all | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
example * VW::import_example | ( | VW::workspace & | all, |
const std::string & | label, | ||
primitive_feature_space * | features, | ||
size_t | len | ||
) |
|
inline |
VW::workspace * VW::initialize | ( | config::options_i & | options, |
io_buf * | model = nullptr , |
||
bool | skip_model_load = false , |
||
trace_message_t | trace_listener = nullptr , |
||
void * | trace_context = nullptr |
||
) |
VW::workspace * VW::initialize | ( | const std::string & | s, |
io_buf * | model = nullptr , |
||
bool | skip_model_load = false , |
||
trace_message_t | trace_listener = nullptr , |
||
void * | trace_context = nullptr |
||
) |
VW::workspace * VW::initialize | ( | int | argc, |
char * | argv[], | ||
io_buf * | model = nullptr , |
||
bool | skip_model_load = false , |
||
trace_message_t | trace_listener = nullptr , |
||
void * | trace_context = nullptr |
||
) |
std::unique_ptr< VW::workspace > VW::initialize | ( | std::unique_ptr< config::options_i > | options, |
std::unique_ptr< VW::io::reader > | model_override_reader = nullptr , |
||
driver_output_func_t | driver_output_func = nullptr , |
||
void * | driver_output_func_context = nullptr , |
||
VW::io::logger * | custom_logger = nullptr |
||
) |
Initialize a workspace.
To intialize a workspace with specific arguments.
To initialize a workspace with a string that needs to be split. VW::split_command_line() can be used to split the string similar to how a shell would
Note: You used to need to call VW::finish() to free the workspace. This is no longer needed and the destructor will free the workspace. However, VW::finish() would also do driver finalization steps, such as writing the output model. This is not often needed in library mode but can be run using VW::workspace::finish().
options | The options to initialize the workspace with. Usually an instance of VW::config::options_cli. |
model_override_reader | optional reading source to read the model from. Will override any model specified on the command line. |
driver_output_func | optional function to forward driver ouput to |
driver_output_func_context | context for driver_output_func |
custom_logger | optional custom logger object to override with |
setup_base | optional advanced override of reduction stack |
VW::workspace * VW::initialize | ( | std::unique_ptr< config::options_i, options_deleter_type > | options, |
io_buf * | model = nullptr , |
||
bool | skip_model_load = false , |
||
trace_message_t | trace_listener = nullptr , |
||
void * | trace_context = nullptr |
||
) |
VW::workspace * VW::initialize_escaped | ( | std::string const & | s, |
io_buf * | model = nullptr , |
||
bool | skip_model_load = false , |
||
trace_message_t | trace_listener = nullptr , |
||
void * | trace_context = nullptr |
||
) |
std::unique_ptr< VW::workspace > VW::initialize_experimental | ( | std::unique_ptr< config::options_i > | options, |
std::unique_ptr< VW::io::reader > | model_override_reader = nullptr , |
||
driver_output_func_t | driver_output_func = nullptr , |
||
void * | driver_output_func_context = nullptr , |
||
VW::io::logger * | custom_logger = nullptr , |
||
std::unique_ptr< VW::setup_base_i > | setup_base = nullptr |
||
) |
Initialize a workspace. This interface is currently experimental, but will replace the existing array of initialize functions.
options | The options to initialize the workspace with. Usually an instance of VW::config::options_cli. |
model_override_reader | optional reading source to read the model from. Will override any model specified on the command line. |
driver_output_func | optional function to forward driver ouput to |
driver_output_func_context | context for driver_output_func |
custom_logger | optional custom logger object to override with |
setup_base | optional advanced override of reduction stack |
VW::workspace * VW::initialize_with_builder | ( | const std::string & | s, |
io_buf * | model = nullptr , |
||
bool | skip_model_load = false , |
||
trace_message_t | trace_listener = nullptr , |
||
void * | trace_context = nullptr , |
||
std::unique_ptr< VW::setup_base_i > | = nullptr |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
bool VW::is_cs_example_header | ( | const VW::example & | ec | ) |
|
inlineconstexpr |
bool VW::is_ring_example | ( | const VW::workspace & | all, |
const example * | ae | ||
) |
std::unique_ptr< T > VW::make_unique | ( | Args &&... | params | ) |
VW::model_delta VW::merge_deltas | ( | const std::vector< const VW::model_delta * > & | deltas_to_merge, |
VW::io::logger * | logger = nullptr |
||
) |
Merge several model deltas into a single delta. This merges weights and all training state. All given deltas must be from compatible models, meaning they should have the same reduction stack and same training based options. All deltas are assumed to be generated using a single shared base workspace.
Note: This is an experimental API.
deltas_to_merge | Vector of model deltas to merge. |
logger | Optional logger to be used for logging during function and is given to the resulting workspace |
std::unique_ptr< VW::workspace > VW::merge_models | ( | const VW::workspace * | base_workspace, |
const std::vector< const VW::workspace * > & | workspaces_to_merge, | ||
VW::io::logger * | logger = nullptr |
||
) |
Merge the differences of several workspaces into the given base workspace. This merges weights and all training state. All given workspaces must be compatible with the base workspace, meaning they should have the same reduction stack and same training based options.
If the base workspace was not given, it is assumed that the given workspaces were trained from fresh.
Note: This is an experimental API.
base_workspace | Optional common base model that all other models continued training from. If not supplied, then all models are assumed to be trained from scratch. |
workspaces_to_merge | Vector of workspaces to merge. |
logger | Optional logger to be used for logging during function and is given to the resulting workspace |
void VW::move_feature_namespace | ( | example * | dst, |
example * | src, | ||
namespace_index | c | ||
) |
example * VW::new_unused_example | ( | VW::workspace & | all | ) |
|
inline |
|
inline |
std::unique_ptr< VW::workspace > VW::operator+ | ( | const VW::workspace & | ws, |
const VW::model_delta & | md | ||
) |
VW::model_delta VW::operator- | ( | const VW::workspace & | ws1, |
const VW::workspace & | ws2 | ||
) |
|
inlineconstexpr |
std::ostream & VW::operator<< | ( | std::ostream & | os, |
const action_score & | a_s | ||
) |
|
inline |
|
inlineconstexpr |
void VW::parse_ccb_label | ( | ccb_label & | ld, |
VW::label_parser_reuse_mem & | reuse_mem, | ||
const std::vector< VW::string_view > & | words, | ||
VW::io::logger & | logger | ||
) |
void VW::parse_example_label | ( | string_view | label, |
const VW::label_parser & | lbl_parser, | ||
const named_labels * | ldict, | ||
label_parser_reuse_mem & | reuse_mem, | ||
example & | ec, | ||
VW::io::logger & | logger | ||
) |
void VW::parse_example_label | ( | VW::workspace & | all, |
example & | ec, | ||
const std::string & | label | ||
) |
void VW::print_decision_scores | ( | VW::io::writer * | f, |
const VW::decision_scores_t & | decision_scores, | ||
VW::io::logger & | logger | ||
) |
void VW::print_update_ccb | ( | VW::workspace & | all, |
const std::vector< example * > & | slots, | ||
const VW::decision_scores_t & | decision_scores, | ||
size_t | num_features | ||
) |
void VW::print_update_slates | ( | VW::workspace & | all, |
const std::vector< example * > & | slots, | ||
const VW::decision_scores_t & | decision_scores, | ||
size_t | num_features | ||
) |
example * VW::read_example | ( | VW::workspace & | all, |
const char * | example_line | ||
) |
example * VW::read_example | ( | VW::workspace & | all, |
const std::string & | example_line | ||
) |
|
inline |
|
inline |
|
inline |
bool VW::read_line_decision_service_json | ( | VW::workspace & | all, |
VW::multi_ex & | examples, | ||
char * | line, | ||
size_t | length, | ||
bool | copy_line, | ||
example_factory_t | example_factory, | ||
VW::parsers::json::decision_service_interaction * | data | ||
) |
template void VW::read_line_json_s< false > | ( | const VW::label_parser & | lbl_parser, |
hash_func_t | hash_func, | ||
uint64_t | hash_seed, | ||
uint64_t | parse_mask, | ||
bool | chain_hash, | ||
VW::label_parser_reuse_mem * | reuse_mem, | ||
const VW::named_labels * | ldict, | ||
VW::multi_ex & | examples, | ||
char * | line, | ||
size_t | length, | ||
example_factory_t | example_factory, | ||
VW::io::logger & | logger, | ||
std::unordered_map< std::string, std::set< std::string > > * | ignore_features, | ||
const std::unordered_map< uint64_t, VW::example * > * | dedup_examples = nullptr |
||
) |
template void VW::read_line_json_s< false > | ( | VW::workspace & | all, |
VW::multi_ex & | examples, | ||
char * | line, | ||
size_t | length, | ||
example_factory_t | example_factory, | ||
const std::unordered_map< uint64_t, VW::example * > * | dedup_examples = nullptr |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void VW::release_feature_space | ( | primitive_feature_space * | features, |
size_t | len | ||
) |
|
inline |
void VW::return_features | ( | feature * | f | ) |
void VW::return_multiple_example | ( | VW::workspace & | all, |
VW::multi_ex & | examples | ||
) |
void VW::save_predictor | ( | VW::workspace & | all, |
const std::string & | reg_name | ||
) |
void VW::save_predictor | ( | VW::workspace & | all, |
io_buf & | buf | ||
) |
|
inlinenoexcept |
Created an RAII object which executes the provided lambda when the scope exits. The primary use case is to handle cleanup in code where exceptions are possible but the code is not exception safe.
std::unique_ptr< VW::workspace > VW::seed_vw_model | ( | VW::workspace & | vw_model, |
const std::vector< std::string > & | extra_args, | ||
driver_output_func_t | driver_output_func = nullptr , |
||
void * | driver_output_func_context = nullptr , |
||
VW::io::logger * | custom_logger = nullptr |
||
) |
Creates a workspace based off of another workspace. What this means is that the model weights and the shared_data object are shared. This function needs to be used with caution. Reduction data is not shared, therefore this function is unsafe to use for situations where reduction state is required for proper operation such as marginal and cb_adf. Learn on a seeded instance is unsafe, and prediction is also potentially unsafe.
VW::workspace * VW::seed_vw_model | ( | VW::workspace * | vw_model, |
const std::string & | extra_args, | ||
trace_message_t | trace_listener = nullptr , |
||
void * | trace_context = nullptr |
||
) |
|
inline |
|
inline |
void VW::setup_example | ( | VW::workspace & | all, |
example * | ae | ||
) |
void VW::setup_examples | ( | VW::workspace & | all, |
VW::multi_ex & | examples | ||
) |
std::vector< VW::string_view > VW::split_by_limit | ( | const VW::string_view & | s, |
size_t | limit | ||
) |
std::vector< std::string > VW::split_command_line | ( | const std::string & | cmd_line | ) |
Split a string like a shell splits a command line. This function handles quotes and escapes.
cmd_line | The command line to split |
std::vector< std::string > VW::split_command_line | ( | VW::string_view | cmd_line | ) |
Split a string like a shell splits a command line. This function handles quotes and escapes.
cmd_line | The command line to split |
void VW::start_parser | ( | VW::workspace & | all | ) |
|
inline |
Check if a string starts with some other string.
full_string | String to check starting of |
starting | Starting value to check |
|
inlinenoexcept |
This guard will replace the location with a default constructed object on creation and upon deletion swap the original value back. This guard is equivalent to swap_guard<T>(xxx, T())
int VW::string_cpy | ( | char * | dest, |
size_t | dest_size, | ||
const char * | src | ||
) |
|
inlinenoexcept |
This guard will swap the two locations on creation and upon deletion swap them back. Note: This overload allows for a temporary value to be passed in.
|
inlinenoexcept |
This guard will swap the two locations on creation and upon deletion swap them back.
void VW::swap_prediction | ( | polyprediction & | a, |
polyprediction & | b, | ||
prediction_type_t | prediction_type | ||
) |
void VW::sync_stats | ( | VW::workspace & | all | ) |
VW::example * VW::test_cb_adf_sequence | ( | const VW::multi_ex & | ec_seq, |
bool | allow_multiple_costs = false |
||
) |
bool VW::test_multiclass_label | ( | const multiclass_label & | ld | ) |
char ** VW::to_argv | ( | std::string const & | s, |
int & | argc | ||
) |
char ** VW::to_argv_escaped | ( | std::string const & | s, |
int & | argc | ||
) |
string_view VW::to_string | ( | cb_type_t | type | ) |
const char * VW::to_string | ( | ccb_example_type | type | ) |
std::string VW::to_string | ( | const action_scores & | action_scores_or_probs, |
int | decimal_precision = details::DEFAULT_FLOAT_PRECISION |
||
) |
|
inline |
std::string VW::to_string | ( | const cb_continuous::continuous_label & | lbl, |
int | decimal_precision = details::DEFAULT_FLOAT_PRECISION |
||
) |
std::string VW::to_string | ( | const cb_continuous::continuous_label_elm & | elm, |
int | decimal_precision = details::DEFAULT_FLOAT_PRECISION |
||
) |
std::string VW::to_string | ( | const continuous_actions::probability_density_function & | pdf, |
int | decimal_precision = details::DEFAULT_FLOAT_PRECISION |
||
) |
std::string VW::to_string | ( | const continuous_actions::probability_density_function_value & | pdf_value, |
int | decimal_precision = details::DEFAULT_FLOAT_PRECISION |
||
) |
std::string VW::to_string | ( | const v_array< float > & | scalars, |
int | decimal_precision = details::DEFAULT_FLOAT_PRECISION |
||
) |
|
inline |
std::string VW::to_string | ( | const VW::decision_scores_t & | decision_scores, |
int | decimal_precision = VW::details::DEFAULT_FLOAT_PRECISION |
||
) |
std::string VW::to_string | ( | const VW::multilabel_label & | multilabels | ) |
std::string VW::to_string | ( | const VW::multilabel_prediction & | multilabels | ) |
string_view VW::to_string | ( | prediction_type_t | ) |
VW::string_view VW::to_string | ( | reductions::automl::automl_state | state | ) |
VW::string_view VW::to_string | ( | reductions::automl::config_state | state | ) |
VW::string_view VW::to_string | ( | reductions::automl::config_type | state | ) |
string_view VW::to_string | ( | VW::label_type_t | ) |
VW::string_view VW::to_string | ( | VW::slates::example_type | ) |
void VW::tokenize | ( | char | delim, |
VW::string_view | s, | ||
ContainerT & | ret, | ||
bool | allow_empty = false |
||
) |
std::string VW::trim_whitespace | ( | const std::string & | s | ) |
Trim whitespace from the beginning and end of a string.
s | The string to trim |
VW::string_view VW::trim_whitespace | ( | VW::string_view | str | ) |
Trim whitespace from the beginning and end of a string.
s | The string to trim |
|
inline |
bool VW::try_extract_random_seed | ( | const VW::example & | ex, |
VW::string_view & | view | ||
) |
|
inline |
void VW::unique_features | ( | features & | fs, |
int | max = -1 |
||
) |
Remove all non unique features from a feature group.
fs | Feature group to remove non-unique features from |
max | The maximum number of unique features to keep. -1 to keep all unique features. |
void VW::unique_sort_features | ( | uint64_t | parse_mask, |
VW::example & | ae | ||
) |
|
inline |
void VW::validate_default_bits | ( | VW::workspace & | all, |
uint32_t | local_num_bits | ||
) |
void VW::validate_min_max_label | ( | VW::workspace & | all | ) |
void VW::validate_num_bits | ( | VW::workspace & | all | ) |
void VW::validate_version | ( | VW::workspace & | all | ) |
|
constexpr |
|
constexpr |
|
inline |
Wrap text by whole words with the given column width.
text | text to wrap |
width | column width to wrap to |
wrap_after | if word causes line to exceed width include word on same line. If false, this word would be wrapped to the next line. |
|
inline |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
constexpr |
|
extern |