Skip to content

Commit

Permalink
deploy: 10100e4
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 20, 2024
1 parent cab3788 commit 1da3225
Show file tree
Hide file tree
Showing 17 changed files with 201 additions and 103 deletions.
21 changes: 21 additions & 0 deletions api/_modules/aepsych/factory/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ <h1>Source code for aepsych.factory.default</h1><div class="highlight"><pre>
<span class="sd"> config details).</span>
<span class="sd"> dim (int, optional): Dimensionality of the parameter space. Must be provided</span>
<span class="sd"> if config is None.</span>
<span class="sd"> stimuli_per_trial (int): Number of stimuli per trial. Defaults to 1.</span>

<span class="sd"> Returns:</span>
<span class="sd"> Tuple[gpytorch.means.Mean, gpytorch.kernels.Kernel]: Instantiated</span>
Expand Down Expand Up @@ -86,6 +87,14 @@ <h1>Source code for aepsych.factory.default</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="nf">_get_default_mean_function</span><span class="p">(</span>
<span class="n">config</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Config</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="n">gpytorch</span><span class="o">.</span><span class="n">means</span><span class="o">.</span><span class="n">ConstantMean</span><span class="p">:</span>
<span class="w"> </span><span class="sd">"""Creates a default mean function for Gaussian Processes.</span>

<span class="sd"> Args:</span>
<span class="sd"> config (Config, optional): Configuration object.</span>

<span class="sd"> Returns:</span>
<span class="sd"> gpytorch.means.ConstantMean: An instantiated mean function with appropriate priors based on the configuration.</span>
<span class="sd"> """</span>
<span class="c1"># default priors</span>
<span class="n">fixed_mean</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">mean</span> <span class="o">=</span> <span class="n">gpytorch</span><span class="o">.</span><span class="n">means</span><span class="o">.</span><span class="n">ConstantMean</span><span class="p">()</span>
Expand All @@ -111,6 +120,18 @@ <h1>Source code for aepsych.factory.default</h1><div class="highlight"><pre>
<span class="n">stimuli_per_trial</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">active_dims</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">int</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="n">gpytorch</span><span class="o">.</span><span class="n">kernels</span><span class="o">.</span><span class="n">Kernel</span><span class="p">:</span>
<span class="w"> </span><span class="sd">"""Creates a default covariance function for Gaussian Processes.</span>
<span class="sd"> </span>
<span class="sd"> Args:</span>
<span class="sd"> config (Config, optional): Configuration object.</span>
<span class="sd"> dim (int): Dimensionality of the parameter space.</span>
<span class="sd"> stimuli_per_trial (int): Number of stimuli per trial.</span>
<span class="sd"> active_dims (List[int], optional): List of dimensions to use in the covariance function. Defaults to None.</span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> gpytorch.kernels.Kernel: An instantiated kernel with appropriate priors based on the configuration.</span>
<span class="sd"> """</span>

<span class="c1"># default priors</span>
<span class="n">lengthscale_prior</span> <span class="o">=</span> <span class="s2">"lognormal"</span> <span class="k">if</span> <span class="n">stimuli_per_trial</span> <span class="o">==</span> <span class="mi">1</span> <span class="k">else</span> <span class="s2">"gamma"</span>
<span class="n">ls_loc</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">tensor</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="mf">2.0</span><span class="p">),</span> <span class="n">dtype</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span>
Expand Down
21 changes: 21 additions & 0 deletions api/_modules/aepsych/factory/default/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ <h1>Source code for aepsych.factory.default</h1><div class="highlight"><pre>
<span class="sd"> config details).</span>
<span class="sd"> dim (int, optional): Dimensionality of the parameter space. Must be provided</span>
<span class="sd"> if config is None.</span>
<span class="sd"> stimuli_per_trial (int): Number of stimuli per trial. Defaults to 1.</span>

<span class="sd"> Returns:</span>
<span class="sd"> Tuple[gpytorch.means.Mean, gpytorch.kernels.Kernel]: Instantiated</span>
Expand Down Expand Up @@ -86,6 +87,14 @@ <h1>Source code for aepsych.factory.default</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="nf">_get_default_mean_function</span><span class="p">(</span>
<span class="n">config</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Config</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="n">gpytorch</span><span class="o">.</span><span class="n">means</span><span class="o">.</span><span class="n">ConstantMean</span><span class="p">:</span>
<span class="w"> </span><span class="sd">"""Creates a default mean function for Gaussian Processes.</span>

<span class="sd"> Args:</span>
<span class="sd"> config (Config, optional): Configuration object.</span>

<span class="sd"> Returns:</span>
<span class="sd"> gpytorch.means.ConstantMean: An instantiated mean function with appropriate priors based on the configuration.</span>
<span class="sd"> """</span>
<span class="c1"># default priors</span>
<span class="n">fixed_mean</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">mean</span> <span class="o">=</span> <span class="n">gpytorch</span><span class="o">.</span><span class="n">means</span><span class="o">.</span><span class="n">ConstantMean</span><span class="p">()</span>
Expand All @@ -111,6 +120,18 @@ <h1>Source code for aepsych.factory.default</h1><div class="highlight"><pre>
<span class="n">stimuli_per_trial</span><span class="p">:</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">active_dims</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">int</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="n">gpytorch</span><span class="o">.</span><span class="n">kernels</span><span class="o">.</span><span class="n">Kernel</span><span class="p">:</span>
<span class="w"> </span><span class="sd">"""Creates a default covariance function for Gaussian Processes.</span>
<span class="sd"> </span>
<span class="sd"> Args:</span>
<span class="sd"> config (Config, optional): Configuration object.</span>
<span class="sd"> dim (int): Dimensionality of the parameter space.</span>
<span class="sd"> stimuli_per_trial (int): Number of stimuli per trial.</span>
<span class="sd"> active_dims (List[int], optional): List of dimensions to use in the covariance function. Defaults to None.</span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> gpytorch.kernels.Kernel: An instantiated kernel with appropriate priors based on the configuration.</span>
<span class="sd"> """</span>

<span class="c1"># default priors</span>
<span class="n">lengthscale_prior</span> <span class="o">=</span> <span class="s2">"lognormal"</span> <span class="k">if</span> <span class="n">stimuli_per_trial</span> <span class="o">==</span> <span class="mi">1</span> <span class="k">else</span> <span class="s2">"gamma"</span>
<span class="n">ls_loc</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">tensor</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="mf">2.0</span><span class="p">),</span> <span class="n">dtype</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span>
Expand Down
10 changes: 10 additions & 0 deletions api/_modules/aepsych/factory/ordinal.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ <h1>Source code for aepsych.factory.ordinal</h1><div class="highlight"><pre>
<div class="viewcode-block" id="ordinal_mean_covar_factory"><a class="viewcode-back" href="../../../factory.html#aepsych.factory.ordinal_mean_covar_factory">[docs]</a><span class="k">def</span> <span class="nf">ordinal_mean_covar_factory</span><span class="p">(</span>
<span class="n">config</span><span class="p">:</span> <span class="n">Config</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tuple</span><span class="p">[</span><span class="n">gpytorch</span><span class="o">.</span><span class="n">means</span><span class="o">.</span><span class="n">ConstantMean</span><span class="p">,</span> <span class="n">gpytorch</span><span class="o">.</span><span class="n">kernels</span><span class="o">.</span><span class="n">ScaleKernel</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">""" Create a mean and covariance function for ordinal GPs.</span>
<span class="sd"> </span>
<span class="sd"> Args:</span>
<span class="sd"> config (Config): Config object containing bounds.</span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> Tuple[gpytorch.means.ConstantMean, gpytorch.kernels.ScaleKernel]: A tuple containing</span>
<span class="sd"> the mean function (ConstantMean) and the covariance function (ScaleKernel).</span>
<span class="sd"> """</span>

<span class="k">try</span><span class="p">:</span>
<span class="n">base_factory</span> <span class="o">=</span> <span class="n">config</span><span class="o">.</span><span class="n">getobj</span><span class="p">(</span><span class="s2">"ordinal_mean_covar_factory"</span><span class="p">,</span> <span class="s2">"base_factory"</span><span class="p">)</span>
<span class="k">except</span> <span class="n">NoOptionError</span><span class="p">:</span>
Expand Down
10 changes: 10 additions & 0 deletions api/_modules/aepsych/factory/ordinal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ <h1>Source code for aepsych.factory.ordinal</h1><div class="highlight"><pre>
<div class="viewcode-block" id="ordinal_mean_covar_factory"><a class="viewcode-back" href="../../../factory.html#aepsych.factory.ordinal_mean_covar_factory">[docs]</a><span class="k">def</span> <span class="nf">ordinal_mean_covar_factory</span><span class="p">(</span>
<span class="n">config</span><span class="p">:</span> <span class="n">Config</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tuple</span><span class="p">[</span><span class="n">gpytorch</span><span class="o">.</span><span class="n">means</span><span class="o">.</span><span class="n">ConstantMean</span><span class="p">,</span> <span class="n">gpytorch</span><span class="o">.</span><span class="n">kernels</span><span class="o">.</span><span class="n">ScaleKernel</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">""" Create a mean and covariance function for ordinal GPs.</span>
<span class="sd"> </span>
<span class="sd"> Args:</span>
<span class="sd"> config (Config): Config object containing bounds.</span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> Tuple[gpytorch.means.ConstantMean, gpytorch.kernels.ScaleKernel]: A tuple containing</span>
<span class="sd"> the mean function (ConstantMean) and the covariance function (ScaleKernel).</span>
<span class="sd"> """</span>

<span class="k">try</span><span class="p">:</span>
<span class="n">base_factory</span> <span class="o">=</span> <span class="n">config</span><span class="o">.</span><span class="n">getobj</span><span class="p">(</span><span class="s2">"ordinal_mean_covar_factory"</span><span class="p">,</span> <span class="s2">"base_factory"</span><span class="p">)</span>
<span class="k">except</span> <span class="n">NoOptionError</span><span class="p">:</span>
Expand Down
8 changes: 8 additions & 0 deletions api/_modules/aepsych/factory/pairwise.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ <h1>Source code for aepsych.factory.pairwise</h1><div class="highlight"><pre>
<div class="viewcode-block" id="pairwise_mean_covar_factory"><a class="viewcode-back" href="../../../factory.html#aepsych.factory.pairwise_mean_covar_factory">[docs]</a><span class="k">def</span> <span class="nf">pairwise_mean_covar_factory</span><span class="p">(</span>
<span class="n">config</span><span class="p">:</span> <span class="n">Config</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tuple</span><span class="p">[</span><span class="n">gpytorch</span><span class="o">.</span><span class="n">means</span><span class="o">.</span><span class="n">ConstantMean</span><span class="p">,</span> <span class="n">gpytorch</span><span class="o">.</span><span class="n">kernels</span><span class="o">.</span><span class="n">ScaleKernel</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">""" Creates a mean and covariance function for pairwise GPs.</span>
<span class="sd"> </span>
<span class="sd"> Args:</span>
<span class="sd"> config (Config): Config object containing bounds.</span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> Tuple[gpytorch.means.ConstantMean, gpytorch.kernels.ScaleKernel]: A tuple containing</span>
<span class="sd"> the mean function (ConstantMean) and the covariance function (ScaleKernel)."""</span>
<span class="n">lb</span> <span class="o">=</span> <span class="n">config</span><span class="o">.</span><span class="n">gettensor</span><span class="p">(</span><span class="s2">"common"</span><span class="p">,</span> <span class="s2">"lb"</span><span class="p">)</span>
<span class="n">ub</span> <span class="o">=</span> <span class="n">config</span><span class="o">.</span><span class="n">gettensor</span><span class="p">(</span><span class="s2">"common"</span><span class="p">,</span> <span class="s2">"ub"</span><span class="p">)</span>
<span class="k">assert</span> <span class="n">lb</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">ub</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s2">"bounds shape mismatch!"</span>
Expand Down
8 changes: 8 additions & 0 deletions api/_modules/aepsych/factory/pairwise/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ <h1>Source code for aepsych.factory.pairwise</h1><div class="highlight"><pre>
<div class="viewcode-block" id="pairwise_mean_covar_factory"><a class="viewcode-back" href="../../../factory.html#aepsych.factory.pairwise_mean_covar_factory">[docs]</a><span class="k">def</span> <span class="nf">pairwise_mean_covar_factory</span><span class="p">(</span>
<span class="n">config</span><span class="p">:</span> <span class="n">Config</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Tuple</span><span class="p">[</span><span class="n">gpytorch</span><span class="o">.</span><span class="n">means</span><span class="o">.</span><span class="n">ConstantMean</span><span class="p">,</span> <span class="n">gpytorch</span><span class="o">.</span><span class="n">kernels</span><span class="o">.</span><span class="n">ScaleKernel</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">""" Creates a mean and covariance function for pairwise GPs.</span>
<span class="sd"> </span>
<span class="sd"> Args:</span>
<span class="sd"> config (Config): Config object containing bounds.</span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> Tuple[gpytorch.means.ConstantMean, gpytorch.kernels.ScaleKernel]: A tuple containing</span>
<span class="sd"> the mean function (ConstantMean) and the covariance function (ScaleKernel)."""</span>
<span class="n">lb</span> <span class="o">=</span> <span class="n">config</span><span class="o">.</span><span class="n">gettensor</span><span class="p">(</span><span class="s2">"common"</span><span class="p">,</span> <span class="s2">"lb"</span><span class="p">)</span>
<span class="n">ub</span> <span class="o">=</span> <span class="n">config</span><span class="o">.</span><span class="n">gettensor</span><span class="p">(</span><span class="s2">"common"</span><span class="p">,</span> <span class="s2">"ub"</span><span class="p">)</span>
<span class="k">assert</span> <span class="n">lb</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">ub</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="s2">"bounds shape mismatch!"</span>
Expand Down
Loading

0 comments on commit 1da3225

Please sign in to comment.