GCOP  1.0
Public Types | Public Member Functions | Public Attributes
gcop::Ce< _n > Class Template Reference

#include <ce.h>

List of all members.

Public Types

typedef Matrix< double, _n, 1 > Vectornd
typedef Matrix< double, _n, _n > Matrixnd

Public Member Functions

 Ce (int n=_n, int k=1, const Matrixnd *S=0)
virtual ~Ce ()
void Reset ()
virtual void AddSample (const Vectornd &z, double c)
void Select ()
bool Fit ()
virtual double Sample (Vectornd &z)
const VectorndBest ()

Public Attributes

int n
 parameter space dimension
Gmm< _n > gmm
 underlying Gaussian-mixture-model
Matrixnd S
 extra noise
vector< pair< Vectornd, double > > zps
 samples (pair of vector and its likelihood)
vector< double > cs
 costs
double rho
 quantile: should be b/n .01 and .1 (default is .1)
double alpha
 update factor: parameter is updated according to v=a*v_new + (1-a)*v_old , i.e. alpha is used to "smooth" the update using the old value (default is .9)
bool mras
 whether to use MRAS version of algorithm, i.e. instead of using rare-event volume estimation, tilt the density optimally using the Gibbs density ~exp(-b*J(z))
double b
 Gibbs factor (only applicable if mras = true)
bool bAuto
 let b be determined automatically (true by default)
bool inc
 incremental version of mras
Vectornd zmin
 current best
double Jmin
 minimum cost
double Jmax
 current Jmax (discard any samples with costs higher than Jmax)
double Jave
 average cost over all samples

Detailed Description

template<int _n = Dynamic>
class gcop::Ce< _n >

Cross-entropy optimization method. One iteration of the algorithm typically includes the following steps:

0. Initialize the GMM distribution, select number of samples N, and quantile rho

1. for 1:N, z = Sample(), c = Cost(z), AddSample(z,c), end

2. Select() selects the top rho-quantile by sorting the samples using their costs

3. Fit() estimates the distribution

4. Best() gives the best sample or just take the first sample in the list of samples as the solution

5. Reset() and goto 1.

Author: Marin Kobilarov marin(at)jhu.edu


Member Typedef Documentation

template<int _n = Dynamic>
typedef Matrix<double, _n, _n> gcop::Ce< _n >::Matrixnd
template<int _n = Dynamic>
typedef Matrix<double, _n, 1> gcop::Ce< _n >::Vectornd

Constructor & Destructor Documentation

template<int _n>
gcop::Ce< _n >::Ce ( int  n = _n,
int  k = 1,
const Matrixnd S = 0 
)

Initialize n-dimensional CE with k modes

Parameters:
nparameter space dimension
knumber of mixture components
Sn-n matrix of random noise to be added to the covariance after GMM estimation; acts both as regularizing factor and also for improving local exploration. This should typically be set to a small value, e.g. a diagonal matrix with entries = 0.01

References gcop::Ce< _n >::S, and gcop::Ce< _n >::zmin.

template<int _n>
gcop::Ce< _n >::~Ce ( ) [virtual]

Member Function Documentation

template<int _n>
void gcop::Ce< _n >::AddSample ( const Vectornd z,
double  c 
) [virtual]

Add a sample to list of samples

Parameters:
zsample
ccost
template<int _n>
const Matrix< double, _n, 1 > & gcop::Ce< _n >::Best ( )

Get the best sample. Equivalent to accessing zps[0].first. This assumes Select() was called to sort the samples.

Returns:
the sample with lowest cost
template<int _n>
bool gcop::Ce< _n >::Fit ( )

Fit GMM to data

template<int _n>
void gcop::Ce< _n >::Reset ( )

Clear samples

template<int _n>
double gcop::Ce< _n >::Sample ( Vectornd z) [virtual]

Draw a sample from the GMM

Parameters:
zvector to be sampled
Returns:
likelihood
template<int _n>
void gcop::Ce< _n >::Select ( )

Select the top quantile. Resizes samples to size N*rho containing the best samples


Member Data Documentation

template<int _n = Dynamic>
double gcop::Ce< _n >::alpha

update factor: parameter is updated according to v=a*v_new + (1-a)*v_old , i.e. alpha is used to "smooth" the update using the old value (default is .9)

template<int _n = Dynamic>
double gcop::Ce< _n >::b

Gibbs factor (only applicable if mras = true)

template<int _n = Dynamic>
bool gcop::Ce< _n >::bAuto

let b be determined automatically (true by default)

template<int _n = Dynamic>
vector<double> gcop::Ce< _n >::cs

costs

template<int _n = Dynamic>
Gmm<_n> gcop::Ce< _n >::gmm

underlying Gaussian-mixture-model

Referenced by gcop::SystemCe< T, n, c, np, ntp, Tc >::SystemCe().

template<int _n = Dynamic>
bool gcop::Ce< _n >::inc

incremental version of mras

template<int _n = Dynamic>
double gcop::Ce< _n >::Jave

average cost over all samples

template<int _n = Dynamic>
double gcop::Ce< _n >::Jmax

current Jmax (discard any samples with costs higher than Jmax)

template<int _n = Dynamic>
double gcop::Ce< _n >::Jmin

minimum cost

template<int _n = Dynamic>
bool gcop::Ce< _n >::mras

whether to use MRAS version of algorithm, i.e. instead of using rare-event volume estimation, tilt the density optimally using the Gibbs density ~exp(-b*J(z))

template<int _n = Dynamic>
int gcop::Ce< _n >::n

parameter space dimension

template<int _n = Dynamic>
double gcop::Ce< _n >::rho

quantile: should be b/n .01 and .1 (default is .1)

template<int _n = Dynamic>
Matrixnd gcop::Ce< _n >::S
template<int _n = Dynamic>
Vectornd gcop::Ce< _n >::zmin

current best

Referenced by gcop::Ce< _n >::Ce().

template<int _n = Dynamic>
vector<pair<Vectornd, double> > gcop::Ce< _n >::zps

samples (pair of vector and its likelihood)


The documentation for this class was generated from the following file: