result = optimize(model, alg, x0, options = options)</code></pre><p>Hyperopt is an optional dependency of Nonconvex so you need to import it in order to use it. <code>HyperoptAlg</code> can wrap any other algorithm in Nonconvex, e.g. <code>IpoptAlg()</code>. When the algorithm is a <code>HyperoptAlg</code>, the <code>options</code> keyword argument must of type <code>HyperoptOptions</code>. For more on the options available see below.</p><h2 id="Construct-an-instance"><a class="docs-heading-anchor" href="#Construct-an-instance">Construct an instance</a><a id="Construct-an-instance-1"></a><a class="docs-heading-anchor-permalink" href="#Construct-an-instance" title="Permalink"></a></h2><p>To construct an instance of the Hyperopt + Ipopt algorithm, use:</p><pre><code class="language-julia hljs">alg = HyperoptAlg(IpoptAlg())</code></pre><p><code>HyperoptAlg</code> can wrap any other algorithm in Nonconvex, e.g. <code>NLoptAlg(:LD_MMA)</code> or <code>AugLag()</code>.</p><h2 id="Options"><a class="docs-heading-anchor" href="#Options">Options</a><a id="Options-1"></a><a class="docs-heading-anchor-permalink" href="#Options" title="Permalink"></a></h2><p>The options keyword argument to the <code>optimize</code> function shown above must be an instance of the <code>HyperoptOptions</code> struct when the algorihm is a <code>HyperoptAlg</code>. To specify options, use keyword arguments in the constructor of <code>HyperoptOptions</code>. The <code>sampler</code> keyword argument determines the sampling algorithm used to propose new starting points in the multi-start procedure. The <code>sub_options</code> keyword argument can be used to pass in the options for the sub-optimizer. There are 2 different ways to pass the sub-options depending on the sampler type.</p><p>The <code>sampler</code> argument can be of type:</p><ol><li><code>RandomSampler</code></li><li><code>LHSampler</code></li><li><code>CLHSampler</code></li><li><code>GPSampler</code></li><li><code>Hyperband</code></li></ol><p>When optimizing the starting point, the upper and lower bounds on the initial solution must be finite, or finite bounds must be passed in to the <code>options</code> constructor. All the options that can be passed to the <code>HyperoptOptions</code> constructor are listed below:</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="NonconvexMultistart.HyperoptOptions" href="#NonconvexMultistart.HyperoptOptions"><code>NonconvexMultistart.HyperoptOptions</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">HyperoptOptions: options performing starting point optimization using Hyperopt.jl</code></pre><ul><li><code>sub_options</code>: options for the sub-optimizer.</li><li><code>lb</code>: Lower bound of starting point, if don't specify it, the default value will be <code>nothing</code>, then will end up be replaced by the lower bound of optimization problem.</li><li><code>ub</code>: Upper bound of starting point, same as above. </li><li><code>searchspace_size::Integer</code>: How many potential starting points we generate.</li><li><code>iters::Integer</code>: Among all generated potential starting points, how many of them will be evaluated. </li><li><code>sampler::Hyperopt.Sampler</code>: An instance of 'Hyperopt.Sampler', which decides search algorithm. </li><li><code>ctol</code>: infeasibility tolerance for accepting a solution as feasible</li><li><code>keep_all</code>: if true, all the solutions of the sub-problems will be saved</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaNonconvex/NonconvexMultistart.jl/blob/v0.1.3/src/hyperopt.jl#L5-L17">source</a></section></article><h3 id="Sampler-choice"><a class="docs-heading-anchor" href="#Sampler-choice">Sampler choice</a><a id="Sampler-choice-1"></a><a class="docs-heading-anchor-permalink" href="#Sampler-choice" title="Permalink"></a></h3><h4 id="RandomSampler,-LHSampler,-CLHSampler-and-GPSampler"><a class="docs-heading-anchor" href="#RandomSampler,-LHSampler,-CLHSampler-and-GPSampler">RandomSampler, LHSampler, CLHSampler and GPSampler</a><a id="RandomSampler,-LHSampler,-CLHSampler-and-GPSampler-1"></a><a class="docs-heading-anchor-permalink" href="#RandomSampler,-LHSampler,-CLHSampler-and-GPSampler" title="Permalink"></a></h4><p>All the sampler constructors are functions defined in Nonconvex wrapping the Hyperopt alternatives to define defaults. For <code>GPSampler</code>, <code>Hyperopt.Min</code> is always used by default in Nonconvex so you should not pass this argument. All the other arguments that can be passed to the sampler constructor can be found in the <a href="https://github.com/baggepinnen/Hyperopt.jl#details">Hyperopt documentation</a>. Example:</p><pre><code class="language-julia hljs">options = HyperoptOptions(sub_options = IpoptOptions(), sampler = GPSampler())</code></pre><h4 id="Hyperband"><a class="docs-heading-anchor" href="#Hyperband">Hyperband</a><a id="Hyperband-1"></a><a class="docs-heading-anchor-permalink" href="#Hyperband" title="Permalink"></a></h4><p>The <a href="https://github.com/baggepinnen/Hyperopt.jl#hyperband">Hyperband algorithm</a> in Hyperopt requires a different way to pass in the sub-options. The Hyperband algorithm tries to optimize the allocation of resources. The <code>sub_options</code> argument must be a function with input as the "resources" and output as the sub-solver options. The <code>Hyperband</code> constructor accepts 3 arguments:</p><ol><li>The maximum resources <code>R</code></li><li><code>η</code> which roughly determines the proportion of trials discarded between each round of successive halving</li><li><code>inner</code> which specifies an inner sampler of type <code>RandomSampler</code>, <code>LHSampler</code> or <code>CLHSampler</code>.</li></ol><p>Example:</p><pre><code class="language-julia hljs">options = HyperoptOptions(
0 commit comments