#include <assert.h>
#include <cmath>
#include <numeric>
#include "random.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 | PERCEPTRON_FIXED_BIAS 0 |
#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 | 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) |
bool | Cholesky_decomp (RMAT &A, RVEC &p) |
void | Cholesky_linsol (const RMAT &A, const RVEC &p, const RVEC &b, RVEC &x) |
bool | lemga::ldivide (RMAT &A, const RVEC &b, RVEC &x) |
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(). |
|
Definition at line 676 of file perceptron.cpp. Referenced by Perceptron::margin_of(), and Perceptron::operator()(). |
|
Definition at line 11 of file perceptron.cpp. Referenced by Perceptron::initialize(), and Perceptron::train(). |
|
Referenced by Perceptron::train(). |
|
Referenced by Perceptron::train(). |
|
Definition at line 13 of file perceptron.cpp. |
|
|
|
Definition at line 25 of file perceptron.cpp. |
|
Definition at line 24 of file perceptron.cpp. |
|
Definition at line 79 of file perceptron.cpp. Referenced by lemga::ldivide(). |
|
Definition at line 99 of file perceptron.cpp. Referenced by lemga::ldivide(). |
|
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(). |
|
|