Vowpal Wabbit
|
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <sstream>
#include <memory>
#include "reductions.h"
#include "rand48.h"
#include "gd.h"
#include "vw.h"
Go to the source code of this file.
Classes | |
struct | nn |
Macros | |
#define | cast_uint32_t static_cast<uint32_t> |
Functions | |
static float | fastpow2 (float p) |
static float | fastexp (float p) |
static float | fasttanh (float p) |
void | finish_setup (nn &n, vw &all) |
void | end_pass (nn &n) |
template<bool is_learn, bool recompute_hidden> | |
void | predict_or_learn_multi (nn &n, single_learner &base, example &ec) |
void | multipredict (nn &n, single_learner &base, example &ec, size_t count, size_t step, polyprediction *pred, bool finalize_predictions) |
void | finish_example (vw &all, nn &, example &ec) |
base_learner * | nn_setup (options_i &options, vw &all) |
Variables | |
constexpr float | hidden_min_activation = -3 |
constexpr float | hidden_max_activation = 3 |
constexpr uint64_t | nn_constant = 533357803 |
#define cast_uint32_t static_cast<uint32_t> |
Definition at line 62 of file nn.cc.
Referenced by fastpow2().
void end_pass | ( | nn & | n | ) |
|
inlinestatic |
Definition at line 79 of file nn.cc.
References f, and fastpow2().
Referenced by ldamath::exponential< float, USE_FAST_APPROX >(), ldamath::fastdigamma(), and fasttanh().
|
inlinestatic |
Definition at line 64 of file nn.cc.
References cast_uint32_t, and f.
Referenced by fastexp(), ldamath::fastexp(), and ldamath::fastpow().
|
inlinestatic |
Definition at line 409 of file nn.cc.
References vw::raw_prediction, and return_simple_example().
Referenced by nn_setup().
Definition at line 83 of file nn.cc.
References vw::audit, constant, constant_namespace, example_predict::feature_space, nn::finished_setup, vw::hash_inv, nn::hiddenbias, example::in_use, nn::increment, example_predict::indices, features::indicies, nn::inpass, example_predict::interactions, vw::interactions, nn::k, example::l, label_data::label, nn_constant, nn_output_namespace, example::num_features, nn::output_layer, nn::outputweight, v_array< T >::push_back(), features::push_back(), polylabel::simple, features::space_names, parameters::stride_shift(), example::total_sum_feat_sq, features::values, example::weight, and vw::weights.
Referenced by predict_or_learn_multi().
void multipredict | ( | nn & | n, |
single_learner & | base, | ||
example & | ec, | ||
size_t | count, | ||
size_t | step, | ||
polyprediction * | pred, | ||
bool | finalize_predictions | ||
) |
Definition at line 391 of file nn.cc.
References c, example_predict::ft_offset, example::partial_prediction, example::pred, and polyprediction::scalar.
Referenced by nn_setup().
base_learner* nn_setup | ( | options_i & | options, |
vw & | all | ||
) |
Definition at line 417 of file nn.cc.
References VW::config::option_group_definition::add(), add(), VW::config::options_i::add_and_parse(), LEARNER::as_singleline(), LEARNER::end_pass(), finish_example(), vw::get_random_state(), getLossFunction(), LEARNER::init_learner(), LEARNER::make_base(), VW::config::make_option(), multipredict(), nn::multitask, vw::quiet, vw::random_seed, LEARNER::learner< T, E >::set_end_pass(), LEARNER::learner< T, E >::set_finish_example(), LEARNER::learner< T, E >::set_multipredict(), setup_base(), vw::training, and VW::config::options_i::was_supplied().
Referenced by parse_reductions().
void predict_or_learn_multi | ( | nn & | n, |
single_learner & | base, | ||
example & | ec | ||
) |
Definition at line 153 of file nn.cc.
References nn::_random_state, add_passthrough_feature, nn::all, nn::dropout, nn::dropped_out, f, fasttanh(), example_predict::feature_space, GD::finalize_prediction(), finish_setup(), nn::finished_setup, loss_function::first_derivative(), example_predict::ft_offset, hidden_max_activation, hidden_min_activation, nn::hidden_units_pred, nn::hiddenbias, nn::hiddenbias_pred, example_predict::indices, features::indicies, nn::inpass, nn::k, example::l, label_data::label, LEARNER::learner< T, E >::learn(), example::loss, vw::loss, shared_data::max_label, merand48(), shared_data::min_label, LEARNER::learner< T, E >::multipredict(), nn::multitask, nn_output_namespace, noop_mm(), nn::output_layer, nn::outputweight, example::partial_prediction, example::passthrough, v_array< T >::pop(), example::pred, LEARNER::learner< T, E >::predict(), nn::prediction, vw::print_text, v_array< T >::push_back(), vw::raw_prediction, prediction_type::scalar, polyprediction::scalar, vw::sd, vw::set_minmax, polylabel::simple, nn::squared_loss, features::sum_feat_sq, example::tag, example::total_sum_feat_sq, vw::training, LEARNER::learner< T, E >::update(), features::values, example::weight, and nn::xsubi.
constexpr float hidden_max_activation = 3 |
Definition at line 21 of file nn.cc.
Referenced by predict_or_learn_multi().
constexpr float hidden_min_activation = -3 |
Definition at line 20 of file nn.cc.
Referenced by predict_or_learn_multi().
constexpr uint64_t nn_constant = 533357803 |
Definition at line 22 of file nn.cc.
Referenced by finish_setup().