Skip to content

Commit 208971f

Browse files
saitcakmakmeta-codesync[bot]
authored andcommitted
Fix typos and docstring issues across botorch (meta-pytorch#3211)
Summary: Pull Request resolved: meta-pytorch#3211 Fix typos, docstring errors, and a copy-paste bug across botorch (excluding acquisition/). **models/** - pairwise_gp.py: "occured" → "occurred", "creteria" → "criteria" (x2), "substition" → "substitution", "the the" → "the", "will filters" → "will be filtered" - map_saas.py: "distrbution" → "distribution", "MixtureGaussiaPosterior" → "GaussianMixturePosterior", "callling" → "calling", "outcome transforms" → "outcome transform" - fully_bayesian.py: "the a" → "a" - transforms/outcome.py: "transfomred" → "transformed" (x4), "currenlty" → "currently", "min_stddv" → "min_stdv" in docstring - transforms/input.py: "acqusition" → "acquisition", added missing `almost_zero` param docs - kernels/linear_truncated_fidelity.py: "parmeters" → "parameters", "the the determistic" → "the deterministic" - gpytorch.py: "its is" → "it is" (x2), "in in" → "in", "which can overwritten" → "which can be overwritten" - higher_order_gp.py: "its is" → "it is", "min_stddv" → "min_stdv" in docstring - model.py: "constitutent" → "constituent", "singe-model" → "single-model" - relevance_pursuit.py: "exluding" → "excluding", copy-paste "expanded" → "contracted" in support_contraction docstring - kernels/contextual_lcea.py: "unbserverable" → "unobservable", "indictor" → "indicator", "contruct" → "construct" - kernels/contextual_sac.py: "oberseving" → "observing", "compponent" → "component" - contextual_multioutput.py: "contruct" → "construct" **optim/** - initializers.py: "dimesional" → "dimensional" (x2), "Intutively" → "Intuitively" (x3), "initital" → "initial", "acquisiton" → "acquisition", swapped class name qHVKG → qKG in docstring, "using to the" → "using the" - optimize.py: "sequentually" → "sequentially", "optmizers" → "optimizers", "occurences" → "occurrences" - parameter_constraints.py: "inptus" → "inputs" **utils/** - sampling.py: "A a" → "A" - multi_objective/hypervolume.py: "acqusition" → "acquisition", removed duplicate "have points that have" - context_managers.py: "orginal" → "original" (x2) - probability/lin_ess.py: "multivariante" → "multivariate" - probability/mvnxpb.py: "G. Tring" → "G. Trinh" (author name) **test_functions/** - synthetic.py: "synthtetic" → "synthetic" (x2), "mininimum" → "minimum", "aproximate" → "approximate", "unreacheable" → "unreachable", "proble problem" → "problem" - sensitivity_analysis.py: "dgsm_gradient_bas" → "dgsm_gradient_abs", **BUG FIX**: gradient_measure used dx_1 for all 3 entries instead of dx_1, dx_2, dx_3 - multi_objective.py: "inputsto" → "inputs to" - multi_fidelity.py: "ther" → "there" - base.py: "ouf" → "of" **exceptions/** - warnings.py: removed phantom `logei_name` param from docstring Reviewed By: dme65 Differential Revision: D94993014 fbshipit-source-id: 2324a2b0b665103b1a680b01014c30d08c524651
1 parent 98c2564 commit 208971f

27 files changed

Lines changed: 76 additions & 74 deletions

botorch/exceptions/warnings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def legacy_ei_numerics_warning(legacy_name: str) -> None:
7272
7373
Args:
7474
legacy_name: The name of the legacy EI acquisition function.
75-
logei_name: The name of the associated LogEI acquisition function.
7675
"""
7776
legacy_to_logei = {
7877
"ExpectedImprovement": "LogExpectedImprovement",

botorch/models/contextual_multioutput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __init__(
142142
(len(context_cat_feature[:, i].unique()), embs_dim_list[i])
143143
for i in range(context_cat_feature.size(1))
144144
]
145-
# contruct embedding layer: need to handle multiple categorical features
145+
# construct embedding layer: need to handle multiple categorical features
146146
self.emb_layers = ModuleList(
147147
[
148148
torch.nn.Embedding(num_embeddings=x, embedding_dim=y, max_norm=1.0)

botorch/models/fully_bayesian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def sample_observations(
381381

382382

383383
class MaternPyroModel(PyroModel):
384-
r"""Implementation of the a fully Bayesian model with a dimension-scaling prior.
384+
r"""Implementation of a fully Bayesian model with a dimension-scaling prior.
385385
386386
``MaternPyroModel`` is not a standard BoTorch model; instead, it is used as
387387
an input to ``FullyBayesianSingleTaskGP``.

botorch/models/gpytorch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def condition_on_observations(
223223
``batch_shape'`` is the batch shape of the observations.
224224
``batch_shape'`` must be broadcastable to ``batch_shape`` using
225225
standard broadcasting semantics. If ``Y`` has fewer batch dimensions
226-
than ``X``, its is assumed that the missing batch dimensions are
226+
than ``X``, it is assumed that the missing batch dimensions are
227227
the same for all ``Y``.
228228
noise: If not ``None``, a tensor of the same shape as ``Y`` representing
229229
the associated noise variance.
@@ -625,7 +625,7 @@ def condition_on_observations(
625625
``batch_shape'`` is the batch shape of the observations.
626626
``batch_shape'`` must be broadcastable to ``batch_shape`` using
627627
standard broadcasting semantics. If ``Y`` has fewer batch dimensions
628-
than ``X``, its is assumed that the missing batch dimensions are
628+
than ``X``, it is assumed that the missing batch dimensions are
629629
the same for all ``Y``.
630630
631631
Returns:
@@ -1034,8 +1034,8 @@ def posterior(
10341034
of points considered jointly. The ``+ 1`` dimension is the optional
10351035
task feature / index. If given, the model produces the outputs for
10361036
the given task indices. If omitted, the model produces outputs for
1037-
tasks in in ``self._output_tasks`` (specified as ``output_tasks``
1038-
while constructing the model), which can overwritten using
1037+
tasks in ``self._output_tasks`` (specified as ``output_tasks``
1038+
while constructing the model), which can be overwritten using
10391039
``output_indices``.
10401040
output_indices: A list of task values over which to compute the posterior.
10411041
Only used if ``X`` does not include the task feature. If omitted,

botorch/models/higher_order_gp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171
Args:
7272
output_shape: A ``n x output_shape``-dim tensor of training targets.
7373
batch_shape: The batch_shape of the training targets.
74-
min_stddv: The minimum standard deviation for which to perform
74+
min_stdv: The minimum standard deviation for which to perform
7575
standardization (if lower, only de-mean the data).
7676
"""
7777
if batch_shape is None:
@@ -417,7 +417,7 @@ def condition_on_observations(
417417
``batch_shape'`` is the batch shape of the observations.
418418
``batch_shape'`` must be broadcastable to ``batch_shape`` using
419419
standard broadcasting semantics. If ``Y`` has fewer batch dimensions
420-
than ``X``, its is assumed that the missing batch dimensions are
420+
than ``X``, it is assumed that the missing batch dimensions are
421421
the same for all ``Y``.
422422
noise: If not None, a tensor of the same shape as ``Y`` representing
423423
the noise variance associated with each observation.

botorch/models/kernels/contextual_lcea.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class LCEAKernel(Kernel):
8787
r"""The Latent Context Embedding Additive (LCE-A) Kernel.
8888
8989
This kernel is similar to the SACKernel, and is used when context breakdowns are
90-
unbserverable. It assumes the same additive structure and a spatial kernel shared
90+
unobservable. It assumes the same additive structure and a spatial kernel shared
9191
across contexts. Rather than assuming independence, LCEAKernel models the
9292
correlation in the latent functions for each context through learning context
9393
embeddings.
@@ -111,7 +111,7 @@ def __init__(
111111
batch_shape: Batch shape as usual for gpytorch kernels. Model does not
112112
support batch training. When batch_shape is non-empty, it is used for
113113
loading hyper-parameter values generated from MCMC sampling.
114-
train_embedding: A boolean indictor of whether to learn context embeddings.
114+
train_embedding: A boolean indicator of whether to learn context embeddings.
115115
cat_feature_dict: Keys are context names and values are list of categorical
116116
features i.e. {"context_name" : [cat_0, ..., cat_k]}. k equals the
117117
number of categorical variables. If None, uses context names in the
@@ -154,7 +154,7 @@ def __init__(
154154
embs_feature_dict=embs_feature_dict,
155155
embs_dim_list=embs_dim_list,
156156
)
157-
# contruct embedding layer
157+
# construct embedding layer
158158
if train_embedding:
159159
self._set_emb_layers()
160160
# task covariance matrix

botorch/models/kernels/contextual_sac.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
class SACKernel(Kernel):
2020
r"""The structural additive contextual(SAC) kernel.
2121
22-
The kernel is used for contextual BO without oberseving context breakdowns.
22+
The kernel is used for contextual BO without observing context breakdowns.
2323
There are d parameters and M contexts. In total, the dimension of parameter space
2424
is d*M and input x can be written as
2525
x=[x_11, ..., x_1d, x_21, ..., x_2d, ..., x_M1, ..., x_Md].
2626
2727
The kernel uses the parameter decomposition and assumes an additive structure
28-
across contexts. Each context compponent is assumed to be independent.
28+
across contexts. Each context component is assumed to be independent.
2929
3030
.. math::
3131
\begin{equation*}

botorch/models/kernels/linear_truncated_fidelity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class LinearTruncatedFidelityKernel(Kernel):
2222
r"""GPyTorch Linear Truncated Fidelity Kernel.
2323
2424
Computes a covariance matrix based on the Linear truncated kernel between
25-
inputs ``x_1`` and ``x_2`` for up to two fidelity parmeters:
25+
inputs ``x_1`` and ``x_2`` for up to two fidelity parameters:
2626
2727
K(x_1, x_2) = k_0 + c_1(x_1, x_2)k_1 + c_2(x_1,x_2)k_2 + c_3(x_1,x_2)k_3
2828
@@ -31,7 +31,7 @@ class LinearTruncatedFidelityKernel(Kernel):
3131
- ``k_i(i=0,1,2,3)`` are Matern kernels calculated between non-fidelity
3232
parameters of ``x_1`` and ``x_2`` with different priors.
3333
- ``c_1=(1 - x_1[f_1])(1 - x_2[f_1]))(1 + x_1[f_1] x_2[f_1])^p`` is the kernel
34-
of the the bias term, which can be decomposed into a determistic part
34+
of the bias term, which can be decomposed into a deterministic part
3535
and a polynomial kernel. Here ``f_1`` is the first fidelity dimension and
3636
``p`` is the order of the polynomial kernel.
3737
- ``c_3`` is the same as ``c_1`` but is calculated for the second fidelity

botorch/models/map_saas.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def get_map_saas_model(
211211
train_Yvar: Optional tensor of shape ``n x 1`` with observed noise,
212212
inferred if None.
213213
input_transform: An optional input transform.
214-
outcome_transform: An optional outcome transforms.
214+
outcome_transform: An optional outcome transform.
215215
tau: Fixed value of the global shrinkage tau. If None, the model
216216
places a HC(0.1) prior on tau and infers it.
217217
@@ -319,7 +319,7 @@ def get_additive_map_saas_covar_module(
319319
320320
The constructed kernel is an additive kernel with ``num_taus`` terms. Each term is a
321321
scaled Matern kernel with a SAAS prior and a tau sampled from a HalfCauchy(0, 1)
322-
distrbution.
322+
distribution.
323323
324324
Args:
325325
ard_num_dims: The number of inputs dimensions.
@@ -425,8 +425,8 @@ def __init__(
425425
num_taus=num_taus,
426426
batch_shape=self._aug_batch_shape,
427427
# Need to pass dtype and device at initialization of the covar_module
428-
# because its priors contain tensors, and prior are currently not moved
429-
# to the correct device/dtype when callling ``to`` on the model.
428+
# because its priors contain tensors, and priors are currently not moved
429+
# to the correct device/dtype when calling ``to`` on the model.
430430
dtype=train_X.dtype,
431431
device=train_X.device,
432432
)
@@ -465,7 +465,7 @@ def __init__(
465465
The model is intended to be trained with ``ExactMarginalLogLikelihood`` and
466466
``fit_gpytorch_mll``. Under the hood, the model is equivalent to a
467467
multi-output ``BatchedMultiOutputGPyTorchModel``, but it produces a
468-
``MixtureGaussiaPosterior``, which leads to ensembling of the model outputs.
468+
``GaussianMixturePosterior``, which leads to ensembling of the model outputs.
469469
470470
Args:
471471
train_X: An ``n x d`` tensor of training features.

botorch/models/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,9 @@ def subset_output(self, idcs: list[int]) -> Model:
541541
the outputs subset to the indices in ``idcs``.
542542
543543
Internally, this drops (if single-output) or subsets (if multi-output)
544-
the constitutent models and returns them as a ``ModelList``. If the
544+
the constituent models and returns them as a ``ModelList``. If the
545545
result is a single (possibly subset) model from the list, returns this
546-
model (instead of forming a degenerate singe-model ``ModelList``).
546+
model (instead of forming a degenerate single-model ``ModelList``).
547547
For instance, if ``m = ModelList(m1, m2)`` with ``m1`` a two-output model
548548
and ``m2`` a single-output model, then ``m.subset_output([1]) `` will return
549549
the model ``m1`` subset to its second output.

0 commit comments

Comments
 (0)