This file is indexed.

/usr/include/openturns/swig/EfficientGlobalOptimization_doc.i is in libopenturns-dev 1.9-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
%feature("docstring") OT::EfficientGlobalOptimization
"Efficient Global Optimization algorithm.

The EGO algorithm [Jones1998]_ is an adaptative optimization method based on
kriging.
An initial design of experiment is used to build a first metamodel.
At each iteration a new point that maximizes a criterion is chosen as
optimizer candidate.
The criterion uses a tradeoff between the metamodel value and the conditional
variance.
Then the new point is evaluated using the original model and the metamodel is
relearnt on the extended design of experiment.

Available constructors:
    EfficientGlobalOptimization(*problem, krigingResult*)

Parameters
----------
problem : :class:`~openturns.OptimizationProblem`
    The optimization problem to solve
    optionally, a 2nd objective marginal can be used as noise
krigingResult : :class:`~openturns.KrigingResult`
    The result of the meta-model on the first design of experiment

Notes
-----
Each point added to the metamodel design seeks to improve the current minimum.
We chose the point so as to maximize an improvement criterion based on the
metamodel.

.. math::

    I(x_{new}) = max(f_{min} - Y_{new}, 0)

The default criteria is called EI (Expected Improvement) and aims at maximizing
the mean improvement:

.. math::

    \\\\mathbb{E}\\\\left[I(x_{new})\\\\right] = \\\\mathbb{E}\\\\left[max(f_{min} - Y_{new}, 0)\\\\right]

This criterion is explicited using the kriging mean and variance:

.. math::

    \\\\mathbb{E}\\\\left[I(x_{new})\\\\right] = (f_{min} - m_K(x_{new})) \\\\Phi\\\\left( \\\\frac{f_{min} - m_K(x_{new})}{s_K(x_{new})} \\\\right) + s_K(x_{new}) \\\\phi\\\\left( \\\\frac{f_{min} - m_K(x_{new})}{s_K(x_{new})} \\\\right)

An observation noise variance can be provided thanks to a 2nd objective marginal.

.. math:: Y_{obs} = Y(x) + \\\\sigma_{\\\\epsilon}(x) \\\\epsilon

In that case the AEI (Augmented Expected Improvement) formulation is used.
As we don't have access to the real minimum of the function anymore a quantile
of the kriging prediction is used, with the constant :math:`c`:

.. math:: u(x) = m_K(x) + c s_K(x)

This criterion is minimized over the design points:

.. math:: x_{min} = \\\\argmax_{x_i} (u(x_i))

The AEI criterion reads:

.. math::

    AEI(x_{new}) = \\\\mathbb{E}\\\\left[max(m_K(x_{min}) - Y_{new}, 0)\\\\right] \\\\times \\\\left(1 - \\\\frac{\\\\sigma_{\\\\epsilon}(x_{new})}{\\\\sqrt{\\\\sigma_{\\\\epsilon}^2(x_{new})+s^2_K(x_{new})}} \\\\right)

with

.. math::

    \\\\mathbb{E}\\\\left[max(m_K(x_{min}) - Y_{new}, 0)\\\\right] = (m_K(x_{min}) - m_K(x_{new})) \\\\Phi\\\\left( \\\\frac{m_K(x_{min}) - m_K(x_{new})}{s_K(x_{new})} \\\\right) + s_K(x_{new}) \\\\phi\\\\left( \\\\frac{m_K(x_{min}) - m_K(x_{new})}{s_K(x_{new})} \\\\right)

A less computationally expensive noise function can be provided through
:func:`setNoiseModel()` to evaluate :math:`\\\\sigma^2_{\\\\epsilon}(x)`
for the improvement criterion optimization, the objective being only used to
compute values and associated noise at design points.

By default the criteria is minimized using :class:`~openturns.MultiStart`
with starting points uniformly sampled in the optimization problem bounds,
see :func:`setMultiStartExperimentSize` and :func:`setMultiStartNumber`.
This behavior can be overridden by using another solver with :func:`setOptimizationAlgorithm`.

Examples
--------
>>> import openturns as ot
>>> ot.RandomGenerator.SetSeed(0)
>>> dim = 4
>>> model = ot.SymbolicFunction(['x1', 'x2', 'x3', 'x4'],
...     ['x1*x1+x2^3*x1+x3+x4'])
>>> bounds = ot.Interval([-5.0] * dim, [5.0] * dim)
>>> problem = ot.OptimizationProblem()
>>> problem.setObjective(model)
>>> problem.setBounds(bounds)
>>> experiment = ot.Composite([0.0] * dim, [1.0, 2.0, 4.0])
>>> inputSample = experiment.generate()
>>> outputSample = model(inputSample)
>>> covarianceModel = ot.SquaredExponential([2.0] * dim, [0.1])
>>> basis = ot.ConstantBasisFactory(dim).build()
>>> kriging = ot.KrigingAlgorithm(inputSample, outputSample, covarianceModel, basis)
>>> kriging.run()
>>> algo = ot.EfficientGlobalOptimization(problem, kriging.getResult())
>>> algo.setMaximumIterationNumber(2)
>>> algo.run()
>>> result = algo.getResult()"

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::setOptimizationAlgorithm
"Expected improvement solver accessor.

Parameters
----------
solver : :class:`~openturns.OptimizationSolver`
    The solver used to optimize the expected improvement"

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getOptimizationAlgorithm
"Expected improvement solver accessor.

Returns
-------
solver : :class:`~openturns.OptimizationSolver`
    The solver used to optimize the expected improvement"

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::setMultiStartExperimentSize
"Size of the design to draw starting points.

Parameters
----------
multiStartExperimentSize : int
    The size of the Monte Carlo design from which to select the best starting
    points.
    The default number can be tweaked with the
    `EfficientGlobalOptimization-DefaultMultiStartExperimentSize` key from
    :class:`~openturns.ResourceMap`."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getMultiStartExperimentSize
"Size of the design to draw starting points.

Returns
-------
multiStartExperimentSize : int
    The size of the Monte Carlo design from which to select the best starting
    points."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::setMultiStartNumber
"Number of starting points for the criterion optimization.

Parameters
----------
multiStartNumber : int
    The number of starting points for the criterion optimization.
    The default number can be tweaked with the
    `EfficientGlobalOptimization-DefaultMultiStartNumber` key from
    :class:`~openturns.ResourceMap`."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getMultiStartNumber
"Number of starting points for the criterion optimization.

Returns
-------
multiStartNumber : int
    The number of starting points for the criterion optimization."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::setParameterEstimationPeriod
"Parameter estimation period accessor.

Parameters
----------
period : int
    The number of iterations between covariance parameters re-learn.
    Default is 1 (each iteration). Can be set to 0 (never).
    The default number can be tweaked with the
    `EfficientGlobalOptimization-DefaultParameterEstimationPeriod` key from
    :class:`~openturns.ResourceMap`."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getParameterEstimationPeriod
"Parameter estimation period accessor.

Returns
-------
period : int
    The number of iterations between covariance parameters re-learn.
    Default is 1 (each iteration). Can be set to 0 (never)."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::setImprovementFactor
"Improvement criterion factor accessor.

Parameters
----------
a : float
    Used to define a stopping criterion on the improvement criterion:
    :math:`I_{max} < \\\\alpha |Y_{min}|`
    with :math:`I_{max}` the current maximum of the improvement
    and :math:`Y_{min}` the current optimum."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getImprovementFactor
"Improvement criterion factor accessor.

Returns
-------
a : float
    Used to define a stopping criterion on the improvement criterion:
    :math:`I_{max} < \\\\alpha |Y_{min}|`
    with :math:`I_{max}` the current maximum of the improvement
    and :math:`Y_{min}` the current optimum."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::setCorrelationLengthFactor
"Correlation length stopping criterion factor accessor.

Parameters
----------
b : float
    Used to define a stopping criterion on the minimum correlation length:
    :math:`\\\\theta_i < \\\\frac{\\\\Delta_i^{min}}{b}`
    with :math:`\\\\Delta^{min}` the minimum distance between design points."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getCorrelationLengthFactor
"Correlation length stopping criterion factor accessor.

Returns
-------
b : float
    Used to define a stopping criterion on the minimum correlation length:
    :math:`\\\\theta_i < \\\\frac{\\\\Delta_i^{min}}{b}`
    with :math:`\\\\Delta^{min}` the minimum distance between design points."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::setAIETradeoff
"AEI tradeoff constant accessor.

Parameters
----------
c : float
    Used to define a quantile of the kriging prediction at the design points.
    :math:`u(x)=m_K(x)+c*s_K(x)`"

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getAIETradeoff
"AEI tradeoff constant accessor.

Returns
-------
c : float
    Used to define a quantile of the kriging prediction at the design points.
    :math:`u(x)=m_K(x)+c*s_K(x)`"

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getExpectedImprovement
"Expected improvement values.

Returns
-------
ei : :class:`~openturns.Sample`
    The expected improvement optimal values."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::setNoiseModel
"Improvement noise model accessor.

Parameters
----------
noiseVariance : :class:`~openturns.Function`
    The noise variance :math:`\\\\sigma^2_{\\\\epsilon}(x)` used for the AEI
    criterion optimization only.
    Of same input dimension than the objective and 1-d output."

// ---------------------------------------------------------------------

%feature("docstring") OT::EfficientGlobalOptimization::getNoiseModel
"Improvement noise model accessor.

Returns
-------
noiseVariance : :class:`~openturns.Function`
    The noise variance :math:`\\\\sigma^2_{\\\\epsilon}(x)` used for the AEI
    criterion optimization only.
    Of same input dimension than the objective and 1-d output."