Click or drag to resize

SystemPerformanceOptimizer Class

Represents a Cross-Entropy program designed to provide the optimization of a system's performance.
Inheritance Hierarchy
SystemObject
  Novacta.Analytics.AdvancedCrossEntropyProgram
    Novacta.Analytics.AdvancedSystemPerformanceOptimizer

Namespace:  Novacta.Analytics.Advanced
Assembly:  Novacta.Analytics (in Novacta.Analytics.dll) Version: 2.0.0
Syntax
public sealed class SystemPerformanceOptimizer : CrossEntropyProgram

The SystemPerformanceOptimizer type exposes the following members.

Constructors
  NameDescription
Public methodSystemPerformanceOptimizer
Initializes a new instance of the SystemPerformanceOptimizer class
Top
Properties
  NameDescription
Public propertyPerformanceEvaluationParallelOptions
Gets or sets options that configure the operation of the Parallel class while computing performance evaluations.
(Inherited from CrossEntropyProgram.)
Public propertySampleGenerationParallelOptions
Gets or sets options that configure the operation of the Parallel class while generating sample points.
(Inherited from CrossEntropyProgram.)
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodEvaluatePerformances
Evaluates the performance of the points in the sample drawn in the current iteration.
(Inherited from CrossEntropyProgram.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOptimize
Runs a Cross-Entropy program designed to optimize a system's performance in the specified context.
Protected methodRun
Runs this Cross-Entropy program in the specified context.
(Inherited from CrossEntropyProgram.)
Protected methodSample
Draws a sample having the specified size from a distribution defined in the given context and characterized by the designated parameter.
(Inherited from CrossEntropyProgram.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

The Cross-Entropy method for combinatorial and multi-extremal optimization

The current implementation of the SystemPerformanceOptimizer class is based on the main Cross-Entropy program for optimization proposed by Rubinstein and Kroese (Algorithm 4.2.1)[1] .

The Cross-Entropy method raises as a solution to the problem of estimating the probability of rare events regarding the performance of complex systems. However, soon the method was recognized as closely related to the optimization of continuous or discrete functions. In fact, optimizing a function is a task that can be accomplished by exploiting the Cross-Entropy machinery aimed to estimate the probability of rare events, since the event represented by a function assuming a value over a given extreme threshold can be typically interpreted as rare.

The Cross-Entropy algorithm for optimization is an adapted version of that for rare event simulation. As the latter, it is an iterative multi step procedure, having two main steps. In the sampling step, the state-space of the system (the domain LaTeX equation of the performance function LaTeX equation, LaTeX equation) is traversed looking for good candidate points at which global performance extrema can be attained. In the subsequent updating step, the distribution from which the states are sampled is modified in order to increase, in the next iterations, the probability of sampling near the true optimizer, say LaTeX equation.

Sampling step

At each iteration LaTeX equation, a sampling step is executed to generate states of the system which are interpreted as candidate arguments of the performance function. It is assumed that such sample is drawn from a specific density or probability function, member of a parametric family

LaTeX equation

where LaTeX equation is a vector representing a possible state of the system, and LaTeX equation is the set of allowable values for parameter LaTeX equation. The parameter exploited at iteration LaTeX equation is referred to as the reference parameter at LaTeX equation and indicated as LaTeX equation.

The parametric family must be carefully chosen. In particular, the first reference parameter, LaTeX equation, must be such that no relevant subsets of the state-space LaTeX equation will receive a too low probability: when starting the search for an optimizer, all possible states must have a real chance of being selected. If there is no a-priori knowledge about the position of the optimizer inside the state-space, it would be very useful if the parametric family could include a parameter such that the corresponding distribution were - at least approximately - uniform on the system's state-space. That parameter would be the perfect candidate for LaTeX equation.

Furthermore, it is expected that, given a reference parameter LaTeX equation, a corresponding reasonable value could be guessed for the optimal argument, say LaTeX equation. In this way, by modifying appropriately the reference parameter, one can suppose to better foresee the optimal argument. Finally, given the optimal reference parameter, say LaTeX equation (the parameter corresponding to the last iteration LaTeX equation executed by the algorithm before stopping), it will be possible to select via LaTeX equation the best argument at which the searched extremum can be considered as reached according to the Cross-Entropy method.

Updating step

Given the sample LaTeX equation drawn at iteration LaTeX equation from distribution LaTeX equation, the main idea behind the Cross-Entropy updating step is that it must be designed to improve the concentration of the probability mass near LaTeX equation. To obtain such result, the updating procedure is based on the sampled points whose performances are more relevant given the optimization goal of the algorithm: if one is maximizing the performance function, then the updating step relies on the states having the highest observed performances; otherwise, the update of the reference parameter is supported by those sampled states corresponding to the lowest performances.

The relevant points are known as elite sample points and can be defined as follows. The sample performances, LaTeX equation, are computed and sorted in increasing order, say obtaining the following ordering:

LaTeX equation

Let LaTeX equation be the sampled state such that LaTeX equation, LaTeX equation, and consider a constant, referred to as the rarity of the program, say LaTeX equation, set to a value in the interval LaTeX equation.

If the optimization goal is a maximization, then the points LaTeX equation occupying a position greater than or equal to LaTeX equation are the elite sampled states, with LaTeX equation being the ceiling function. In this case, the current iteration is said to reach a performance level equal to LaTeX equation.

Otherwise, if the optimization goal is a minimization, then the elite sampled states can be defined as those points occupying a position less than or equal to LaTeX equation, where LaTeX equation is the floor function. Such points are thus LaTeX equation, and the current iteration is said to reach a performance level equal to LaTeX equation.

The joint distribution from which the states will be sampled in the next iteration is updated exploiting the elite states only: in this way, given that the performances of the elite points are likely to be similar to that at LaTeX equation, it can be expected that such choice will push LaTeX equation towards LaTeX equation.

In addition, to achieve the convergence of the algorithm, the mass also needs to accumulate near LaTeX equation. Such result can be obtained by estimating via the Cross-Entropy method the probability of a rare event: in case of maximization, the event of interest being

LaTeX equation

or, if LaTeX equation must be minimized,

LaTeX equation

The target probability can thus be represented as

LaTeX equation

where LaTeX equation is LaTeX equation or LaTeX equation, and LaTeX equation is the indicator function of LaTeX equation.

The Cross-Entropy method selects another density in LaTeX equation by identifying a parameter LaTeX equation that guarantees the most accurate estimate of the target probability for a specified simulation effort, or sample size LaTeX equation, by taking into account the Likelihood estimator based on the ratio

LaTeX equation

where

LaTeX equation

is the density of LaTeX equation conditional on LaTeX equation.

Such estimator is unusable, since it depends on the target probability. However, it is ideally optimal because its variance is equal to zero. For this reason, it is proposed to select the parameter LaTeX equation such that the corresponding density LaTeX equation is the closest to the optimal one, the difference between two densities, say LaTeX equation and LaTeX equation, being measured as a Kullback–Leibler divergence:

LaTeX equation

The selection is thus obtained by minimizing the divergence between the generic density in LaTeX equation, say LaTeX equation, and the ideal density LaTeX equation:

LaTeX equation

Such minimization corresponds to the maximization

LaTeX equation

where LaTeX equation is the expectation operator under LaTeX equation. This implies that, given a sample LaTeX equation from LaTeX equation, a solution to such optimization can be estimated through the solution to the program:

LaTeX equation

where

LaTeX equation

and

LaTeX equation

The interest in such an approach is due to the possibility of choosing the new parameter LaTeX equation under which the event LaTeX equation becomes less rare under density LaTeX equation than under density LaTeX equation: the mass concentration becomes higher. In this way, by decreasing the rareness of LaTeX equation, a smaller simulation effort would be required in order to obtain a good estimation, since a higher mass concentration is attained. The iteration parameter LaTeX equation is thus chosen to be the optimal one in LaTeX equation for estimating LaTeX equation:

LaTeX equation

and LaTeX equation can be interpreted as the Maximum Likelihood estimate of LaTeX equation based only on the elite sample points.

By default, the algorithm stops iterating when the iteration level does not change for a predefined number of iterations, or the number of executed iterations reaches a specified maximum.

Executing a Cross-Entropy optimizer

Class SystemPerformanceOptimizer follows the Template Method pattern[2] by defining in an operation the structure of a Cross-Entropy algorithm aimed to optimize the performance of a system. Optimize is the template method, in which the invariant parts of a Cross-Entropy optimizer are implemented once, deferring the implementation of behaviors that can vary to a SystemPerformanceOptimizationContext instance, that method Optimize receives as a parameter.

SystemPerformanceOptimizationContext inherits or defines abstract or virtual methods which represent some primitive operations of the template method, i.e. those varying steps that its subclasses will override to define the concrete behavior of the algorithm. See the documentation of class SystemPerformanceOptimizationContext for examples of how to implement a context for system's performance optimization.

Bibliography
[1] Rubinstein, R.Y. and Kroese, D.P., The Cross-Entropy Method, A unified Approach to Combinatorial Optimization, Monte-Carlo Simulation, and Machine Learning, Springer, New York. (2004)
[2] Gamma, E., Helm, R., Johnson, R. and Vlissides, J., Design Patterns, Elements of Reusable Object-Oriented Software, Addison-Wesley, Reading, MA. (1995)
See Also