Skip to content

Commit 801f6d2

Browse files
MAINT: add warning and fix doc (#3974)
1 parent 3b765a5 commit 801f6d2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: pymc3/gp/cov.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import warnings
1516
import numpy as np
1617
import theano
1718
import theano.tensor as tt
@@ -85,6 +86,11 @@ def full(self, X, Xs):
8586
raise NotImplementedError
8687

8788
def _slice(self, X, Xs):
89+
if self.input_dim != X.shape[-1]:
90+
warnings.warn(f"Only {self.input_dim} column(s) out of {X.shape[-1]} are"
91+
" being used to compute the covariance function. If this"
92+
" is not intended, increase 'input_dim' parameter to"
93+
" the number of columns to use. Ignore otherwise.", UserWarning)
8894
X = tt.as_tensor_variable(X[:, self.active_dims])
8995
if Xs is not None:
9096
Xs = tt.as_tensor_variable(Xs[:, self.active_dims])
@@ -467,7 +473,7 @@ class Cosine(Stationary):
467473
The Cosine kernel.
468474
469475
.. math::
470-
k(x, x') = \mathrm{cos}\left( \pi \frac{||x - x'||}{ \ell^2} \right)
476+
k(x, x') = \mathrm{cos}\left( 2 \pi \frac{||x - x'||}{ \ell^2} \right)
471477
"""
472478

473479
def full(self, X, Xs=None):

0 commit comments

Comments
 (0)