GCOP
1.0
|
#include <ce.h>
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 Vectornd & | Best () |
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 |
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
Initialize n-dimensional CE with k modes
n | parameter space dimension |
k | number of mixture components |
S | n-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.
Add a sample to list of samples
z | sample |
c | cost |
Get the best sample. Equivalent to accessing zps[0].first. This assumes Select() was called to sort the samples.
Draw a sample from the GMM
z | vector to be sampled |
Select the top quantile. Resizes samples to size N*rho containing the best samples
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)
let b be determined automatically (true by default)
underlying Gaussian-mixture-model
Referenced by gcop::SystemCe< T, n, c, np, ntp, Tc >::SystemCe().
current Jmax (discard any samples with costs higher than Jmax)
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))
quantile: should be b/n .01 and .1 (default is .1)
extra noise
Referenced by gcop::Ce< _n >::Ce(), and gcop::SystemCe< T, n, c, np, ntp, Tc >::SystemCe().
current best
Referenced by gcop::Ce< _n >::Ce().
samples (pair of vector and its likelihood)