File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1
1
from scipy .cluster .vq import kmeans
2
2
import numpy as np
3
+ import pymc3 as pm
4
+ import theano .tensor as tt
5
+
6
+
7
+ cholesky = pm .distributions .dist_math .Cholesky (nofail = True , lower = True )
8
+ solve_lower = tt .slinalg .Solve (A_structure = 'lower_triangular' )
9
+ solve_upper = tt .slinalg .Solve (A_structure = 'upper_triangular' )
10
+ solve = tt .slinalg .Solve (A_structure = 'general' )
11
+
12
+
13
+ def infer_shape (X , n_points = None ):
14
+ if n_points is None :
15
+ try :
16
+ n_points = np .int (X .shape [0 ])
17
+ except TypeError :
18
+ raise TypeError ("Cannot infer n_points, provide as an argument" )
19
+ return n_points
20
+
21
+
22
+ def stabilize (K ):
23
+ """ adds small diagonal to a covariance matrix """
24
+ return K + 1e-6 * tt .identity_like (K )
25
+
3
26
4
27
def kmeans_inducing_points (n_inducing , X ):
5
28
# first whiten X
You can’t perform that action at this time.
0 commit comments