You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for providing this fantastic library. I'm interested in adding a new algorithm, specifically the 'cross-entropy method.'
Could you please provide an example or guidance on how to do this?
Thank you.
The text was updated successfully, but these errors were encountered:
For your case, to implement a typical "cross-entropy method" (from wikipedia)
// Initialize parameters
μ := −6
σ2 := 100
t := 0
maxits := 100
N := 100
Ne := 10
// While maxits not exceeded and not converged
while t < maxits and σ2 > ε do
// Obtain N samples from current sampling distribution
X := SampleGaussian(μ, σ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 via elite samples
μ := mean(X(1:Ne))
σ2 := var(X(1:Ne))
t := t + 1
// Return mean of final sampling distribution as solution
return μ
You will need to implement the following methods of the Algorithm class
__init__
setup initialize μ, σ2 here as the state of this algorithm, because these two are changing throughout the iterations.
Hi,
Thank you for providing this fantastic library. I'm interested in adding a new algorithm, specifically the 'cross-entropy method.'
Could you please provide an example or guidance on how to do this?
Thank you.
The text was updated successfully, but these errors were encountered: