Skip to content

Commit

Permalink
Update latest version of site
Browse files Browse the repository at this point in the history
  • Loading branch information
docusaurus-bot committed Aug 29, 2023
1 parent 0578bd8 commit 58b0772
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 287 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="bp">self</span><span class="p">,</span>
<span class="n">n_w</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">preprocessing_function</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Callable</span><span class="p">[[</span><span class="n">Tensor</span><span class="p">],</span> <span class="n">Tensor</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">weights</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">float</span><span class="p">],</span> <span class="n">Tensor</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">"""Transform the posterior samples to samples of a risk measure.</span>

Expand All @@ -98,13 +97,8 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="sd"> maximization. For constrained optimization, this should also</span>
<span class="sd"> apply feasibility-weighting to samples. Given a `batch x m`-dim</span>
<span class="sd"> tensor of samples, this should return a `batch x m'`-dim tensor.</span>
<span class="sd"> weights: An optional `m`-dim tensor or list of weights for scaling</span>
<span class="sd"> multi-output samples before calculating the risk measure.</span>
<span class="sd"> Deprecated, use `preprocessing_function` instead.</span>
<span class="sd"> """</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
<span class="n">n_w</span><span class="o">=</span><span class="n">n_w</span><span class="p">,</span> <span class="n">preprocessing_function</span><span class="o">=</span><span class="n">preprocessing_function</span><span class="p">,</span> <span class="n">weights</span><span class="o">=</span><span class="n">weights</span>
<span class="p">)</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">n_w</span><span class="o">=</span><span class="n">n_w</span><span class="p">,</span> <span class="n">preprocessing_function</span><span class="o">=</span><span class="n">preprocessing_function</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_prepare_samples</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">samples</span><span class="p">:</span> <span class="n">Tensor</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tensor</span><span class="p">:</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">"""Prepare samples for risk measure calculations by scaling and</span>
Expand Down Expand Up @@ -279,7 +273,7 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="n">alpha</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
<span class="n">expectation</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">preprocessing_function</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Callable</span><span class="p">[[</span><span class="n">Tensor</span><span class="p">],</span> <span class="n">Tensor</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">weights</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">float</span><span class="p">],</span> <span class="n">Tensor</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="o">*</span><span class="p">,</span>
<span class="n">pad_to_n_w</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">filter_dominated</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
Expand All @@ -298,9 +292,6 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="sd"> maximization. For constrained optimization, this should also</span>
<span class="sd"> apply feasibility-weighting to samples. Given a `batch x m`-dim</span>
<span class="sd"> tensor of samples, this should return a `batch x m'`-dim tensor.</span>
<span class="sd"> weights: An optional `m`-dim tensor or list of weights for scaling</span>
<span class="sd"> multi-output samples before calculating the risk measure.</span>
<span class="sd"> Deprecated, use `preprocessing_function` instead.</span>
<span class="sd"> pad_to_n_w: If True, instead of padding up to `k'`, which is the size of</span>
<span class="sd"> the largest MVaR set across all batches, we pad the MVaR set up to</span>
<span class="sd"> `n_w`. This produces a return tensor of known size, however, it may</span>
Expand All @@ -314,9 +305,7 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="sd"> calculating the hypervolume. Disabling this is not recommended</span>
<span class="sd"> if `expectation=True`.</span>
<span class="sd"> """</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
<span class="n">n_w</span><span class="o">=</span><span class="n">n_w</span><span class="p">,</span> <span class="n">preprocessing_function</span><span class="o">=</span><span class="n">preprocessing_function</span><span class="p">,</span> <span class="n">weights</span><span class="o">=</span><span class="n">weights</span>
<span class="p">)</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">n_w</span><span class="o">=</span><span class="n">n_w</span><span class="p">,</span> <span class="n">preprocessing_function</span><span class="o">=</span><span class="n">preprocessing_function</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="mi">0</span> <span class="o">&lt;</span> <span class="n">alpha</span> <span class="o">&lt;=</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"`alpha` must be in (0.0, 1.0]"</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">alpha</span> <span class="o">=</span> <span class="n">alpha</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="bp">self</span><span class="p">,</span>
<span class="n">n_w</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">preprocessing_function</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Callable</span><span class="p">[[</span><span class="n">Tensor</span><span class="p">],</span> <span class="n">Tensor</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">weights</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">float</span><span class="p">],</span> <span class="n">Tensor</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">"""Transform the posterior samples to samples of a risk measure.</span>

Expand All @@ -98,13 +97,8 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="sd"> maximization. For constrained optimization, this should also</span>
<span class="sd"> apply feasibility-weighting to samples. Given a `batch x m`-dim</span>
<span class="sd"> tensor of samples, this should return a `batch x m'`-dim tensor.</span>
<span class="sd"> weights: An optional `m`-dim tensor or list of weights for scaling</span>
<span class="sd"> multi-output samples before calculating the risk measure.</span>
<span class="sd"> Deprecated, use `preprocessing_function` instead.</span>
<span class="sd"> """</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
<span class="n">n_w</span><span class="o">=</span><span class="n">n_w</span><span class="p">,</span> <span class="n">preprocessing_function</span><span class="o">=</span><span class="n">preprocessing_function</span><span class="p">,</span> <span class="n">weights</span><span class="o">=</span><span class="n">weights</span>
<span class="p">)</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">n_w</span><span class="o">=</span><span class="n">n_w</span><span class="p">,</span> <span class="n">preprocessing_function</span><span class="o">=</span><span class="n">preprocessing_function</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_prepare_samples</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">samples</span><span class="p">:</span> <span class="n">Tensor</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tensor</span><span class="p">:</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">"""Prepare samples for risk measure calculations by scaling and</span>
Expand Down Expand Up @@ -279,7 +273,7 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="n">alpha</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
<span class="n">expectation</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">preprocessing_function</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Callable</span><span class="p">[[</span><span class="n">Tensor</span><span class="p">],</span> <span class="n">Tensor</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">weights</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">float</span><span class="p">],</span> <span class="n">Tensor</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="o">*</span><span class="p">,</span>
<span class="n">pad_to_n_w</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">filter_dominated</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
Expand All @@ -298,9 +292,6 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="sd"> maximization. For constrained optimization, this should also</span>
<span class="sd"> apply feasibility-weighting to samples. Given a `batch x m`-dim</span>
<span class="sd"> tensor of samples, this should return a `batch x m'`-dim tensor.</span>
<span class="sd"> weights: An optional `m`-dim tensor or list of weights for scaling</span>
<span class="sd"> multi-output samples before calculating the risk measure.</span>
<span class="sd"> Deprecated, use `preprocessing_function` instead.</span>
<span class="sd"> pad_to_n_w: If True, instead of padding up to `k'`, which is the size of</span>
<span class="sd"> the largest MVaR set across all batches, we pad the MVaR set up to</span>
<span class="sd"> `n_w`. This produces a return tensor of known size, however, it may</span>
Expand All @@ -314,9 +305,7 @@ <h1>Source code for botorch.acquisition.multi_objective.multi_output_risk_measur
<span class="sd"> calculating the hypervolume. Disabling this is not recommended</span>
<span class="sd"> if `expectation=True`.</span>
<span class="sd"> """</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
<span class="n">n_w</span><span class="o">=</span><span class="n">n_w</span><span class="p">,</span> <span class="n">preprocessing_function</span><span class="o">=</span><span class="n">preprocessing_function</span><span class="p">,</span> <span class="n">weights</span><span class="o">=</span><span class="n">weights</span>
<span class="p">)</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">n_w</span><span class="o">=</span><span class="n">n_w</span><span class="p">,</span> <span class="n">preprocessing_function</span><span class="o">=</span><span class="n">preprocessing_function</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="mi">0</span> <span class="o">&lt;</span> <span class="n">alpha</span> <span class="o">&lt;=</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"`alpha` must be in (0.0, 1.0]"</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">alpha</span> <span class="o">=</span> <span class="n">alpha</span>
Expand Down
Loading

0 comments on commit 58b0772

Please sign in to comment.