#include <assert.h>#include <cmath>#include <numeric>#include "random.h"#include "utility.h"#include "stump.h"#include "perceptron.h"Include dependency graph for perceptron.cpp:

Go to the source code of this file.
Namespaces | |
| namespace | lemga |
Defines | |
| #define | STUMP_DOUBLE_DIRECTIONS 0 |
| #define | DOTPROD(x, y) std::inner_product(x.begin(), x.end(), y.begin(), .0) |
| #define | DOTPROD_NB(x, y) std::inner_product(x.begin(),x.end()-1,y.begin(),.0) |
| #define | RAND_IDX() (resample? randcdf(randu(),cdf) : UINT(randu()*n_samples)) |
| #define | SAMPWGT(i) (resample? 1 : (*ptw)[i]*n_samples) |
| #define | GET_XYO(i) |
| #define | CYCLE(r) (((r)+dim-1) % udim) |
| #define | UPDATE_WGT(d) update_wgt(wgt, d, X, Y) |
| #define | INIT_RCD() |
| #define | INPUT_SUM(w, x) std::inner_product(x.begin(), x.end(), w.begin(), w.back()) |
Typedefs | |
| typedef std::vector< REAL > | RVEC |
| typedef std::vector< RVEC > | RMAT |
Functions | |
| REGISTER_CREATOR (lemga::Perceptron) | |
| RVEC | randvec (UINT n) |
| RVEC | coorvec (UINT n, UINT c) |
| void | normalize (RVEC &v, REAL thr=0) |
| RMAT | randrot (UINT n, bool bias_row=false, bool conjugate=true) |
| void | lemga::update_wgt (RVEC &wgt, const RVEC &dir, const RMAT &X, const RVEC &y) |
| void | lemga::dset_extract (const pDataSet &ptd, RMAT &X, RVEC &y) |
| void | lemga::dset_mult_wgt (const pDataWgt &ptw, RVEC &y) |
| UINT | lemga::randcdf (REAL r, const RVEC &cdf) |
Definition in file perceptron.cpp.
|
|
|
|
|
Definition at line 27 of file perceptron.cpp. |
|
|
Definition at line 29 of file perceptron.cpp. Referenced by Perceptron::w_norm(). |
|
|
Value: Referenced by Perceptron::train(). |
|
|
Value: { \
dset_mult_wgt(ptw, Y); \
}
|
|
|
Definition at line 618 of file perceptron.cpp. Referenced by Perceptron::margin_of(), and Perceptron::operator()(). |
|
|
Referenced by Perceptron::train(). |
|
|
Referenced by Perceptron::train(). |
|
|
Definition at line 12 of file perceptron.cpp. |
|
|
|
|
|
Definition at line 25 of file perceptron.cpp. |
|
|
Definition at line 24 of file perceptron.cpp. |
|
||||||||||||
|
Definition at line 38 of file perceptron.cpp. Referenced by randrot(). |
|
||||||||||||
|
Definition at line 44 of file perceptron.cpp. References DOTPROD. |
|
||||||||||||||||
|
Definition at line 53 of file perceptron.cpp. |
|
|
Definition at line 31 of file perceptron.cpp. References randu. Referenced by randrot(). |
|
|
|
1.4.6