Cross-entropy method: Difference between revisions

Content deleted Content added
m Changed the name of the function from S(x) to S.
m Pseudocode: ''html entities''
Line 52:
 
===Pseudocode===
''// Initialize parameters''
μ := −6
sigma2σ2 := 100
t := 0
maxits := 100
N := 100
Ne := 10
''// While maxits not exceeded and not converged''
'''while''' t < maxits '''and''' sigma2&sigma;2 > epsilon '''do'''
''// Obtain N samples from current sampling distribution''
X := SampleGaussian(&mu;, sigma2&sigma;2, N)
''// Evaluate objective function at sampled points''
S := exp(−(X − 2) ^ 2) + 0.8 exp(−(X + 2) ^ 2)
''// Sort X by objective function values in descending order''
X := sort(X, S)
''// Update parameters of sampling distribution''
&mu; := mean(X(1:Ne))
sigma2&sigma;2 := var(X(1:Ne))
t := t + 1
''// Return mean of final sampling distribution as solution''
'''return''' mu