A single-Poisson/Gamma SurpriseModel. More...
#include <Surprise/SurpriseModel.H>
Public Member Functions | |
SurpriseModelSPF (const double updatefac=0.5, const double sampleval=0.0, const double samplevar=1.0) | |
Constructor. See base class for details. | |
virtual | ~SurpriseModelSPF () |
Virtual destructor ensures proper destruction of derived classes. | |
virtual void | reset () |
Reset to initial state. | |
virtual void | init (const double updatefac=0.5, const double sampleval=0.0, const double samplevar=1.0) |
Change intial state parameters. | |
virtual void | load (const double sampleval, const double samplevar=1.0) |
Load given sample mean and variance. | |
virtual double | surprise (const SurpriseModelSPF &other) |
Compute surprise between us and another model. | |
virtual void | preComputeHyperParams (const SurpriseModelSPF &sample) |
Is empty in this model. | |
virtual void | combineFrom (const Image< SurpriseModelSPF > &models, const Image< float > &weights) |
Initialize us as a weighted combination of the given map of models. | |
virtual void | combineFrom (const Image< SurpriseModelSPF > &models, const Image< float > &weights, const Point2D< int > &pos, const int width, const int height, const int offset) |
Initialize us as a weighted combination of the given map of models. | |
virtual double | getMean () const |
get our mean | |
virtual double | getVar () const |
get our variance | |
virtual double | getUpdateFac () const |
get our UpdateFac | |
double | getAlpha () const |
get our alpha | |
double | getBeta () const |
get out beta | |
void | preSetAlpha () |
Pre set model alpha values. | |
Protected Attributes | |
int | itsN |
our sample N | |
double | itsAlpha |
our current Gamma alpha | |
double | itsBeta |
double | itsLastS |
double | itsSFac |
A single-Poisson/Gamma SurpriseModel.
This is a very simple SurpriseModel consisting of a single Gamma prior over Poisson, which is updated in a sliding-average manner.
This variant floats the beta term which may be useful for multi frame inputs
<<Experimental>>
Definition at line 423 of file SurpriseModel.H.
SurpriseModelSPF::SurpriseModelSPF | ( | const double | updatefac = 0.5 , |
|
const double | sampleval = 0.0 , |
|||
const double | samplevar = 1.0 | |||
) |
Constructor. See base class for details.
Definition at line 706 of file SurpriseModel.C.
SurpriseModelSPF::~SurpriseModelSPF | ( | ) | [virtual] |
Virtual destructor ensures proper destruction of derived classes.
Definition at line 716 of file SurpriseModel.C.
void SurpriseModelSPF::combineFrom | ( | const Image< SurpriseModelSPF > & | models, | |
const Image< float > & | weights, | |||
const Point2D< int > & | pos, | |||
const int | width, | |||
const int | height, | |||
const int | offset | |||
) | [inline, virtual] |
Initialize us as a weighted combination of the given map of models.
Definition at line 793 of file SurpriseModel.C.
void SurpriseModelSPF::combineFrom | ( | const Image< SurpriseModelSPF > & | models, | |
const Image< float > & | weights | |||
) | [inline, virtual] |
Initialize us as a weighted combination of the given map of models.
Definition at line 783 of file SurpriseModel.C.
double SurpriseModelSPF::getAlpha | ( | ) | const [inline] |
double SurpriseModelSPF::getBeta | ( | ) | const [inline] |
get out beta
Definition at line 830 of file SurpriseModel.C.
double SurpriseModelSPF::getMean | ( | ) | const [inline, virtual] |
get our mean
Implements SurpriseModel.
Definition at line 814 of file SurpriseModel.C.
References itsAlpha.
double SurpriseModelSPF::getUpdateFac | ( | ) | const [inline, virtual] |
get our UpdateFac
Implements SurpriseModel.
Definition at line 822 of file SurpriseModel.C.
References SurpriseModel::itsUpdateFac.
double SurpriseModelSPF::getVar | ( | ) | const [inline, virtual] |
get our variance
Implements SurpriseModel.
Definition at line 818 of file SurpriseModel.C.
References itsAlpha.
void SurpriseModelSPF::init | ( | const double | updatefac = 0.5 , |
|
const double | sampleval = 0.0 , |
|||
const double | samplevar = 1.0 | |||
) | [inline, virtual] |
Change intial state parameters.
Reimplemented from SurpriseModel.
Definition at line 724 of file SurpriseModel.C.
References load().
void SurpriseModelSPF::load | ( | const double | sampleval, | |
const double | samplevar = 1.0 | |||
) | [inline, virtual] |
Load given sample mean and variance.
Implements SurpriseModel.
Definition at line 733 of file SurpriseModel.C.
References itsAlpha, itsN, and SurpriseModel::itsUpdateFac.
void SurpriseModelSPF::preComputeHyperParams | ( | const SurpriseModelSPF & | sample | ) | [inline, virtual] |
Is empty in this model.
Definition at line 765 of file SurpriseModel.C.
void SurpriseModelSPF::preSetAlpha | ( | ) |
void SurpriseModelSPF::reset | ( | void | ) | [inline, virtual] |
Reset to initial state.
Implements SurpriseModel.
Definition at line 720 of file SurpriseModel.C.
References SurpriseModel::itsInitialVal, SurpriseModel::itsInitialVar, and load().
double SurpriseModelSPF::surprise | ( | const SurpriseModelSPF & | other | ) | [inline, virtual] |
Compute surprise between us and another model.
Definition at line 741 of file SurpriseModel.C.
References itsAlpha, itsN, and SurpriseModel::itsUpdateFac.
double SurpriseModelSPF::itsAlpha [protected] |
our current Gamma alpha
Definition at line 479 of file SurpriseModel.H.
Referenced by getAlpha(), getMean(), getVar(), load(), preSetAlpha(), and surprise().
int SurpriseModelSPF::itsN [protected] |