File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
import theano .tensor as tt
2
2
3
- __all__ = ['Zero' , 'Constant' ]
3
+ __all__ = ['Zero' , 'Constant' , 'Linear' ]
4
+
4
5
5
6
class Mean (object ):
6
7
R"""
7
8
Base class for mean functions
8
9
"""
10
+
9
11
def __call__ (self , X ):
10
12
R"""
11
13
Evaluate the mean function.
@@ -22,14 +24,17 @@ def __add__(self, other):
22
24
def __mul__ (self , other ):
23
25
return Prod (self , other )
24
26
27
+
25
28
class Zero (Mean ):
26
29
R"""
27
30
Zero mean function for Gaussian process.
28
31
29
32
"""
33
+
30
34
def __call__ (self , X ):
31
35
return tt .zeros (tt .stack ([X .shape [0 ], ]), dtype = 'float32' )
32
36
37
+
33
38
class Constant (Mean ):
34
39
R"""
35
40
Constant mean function for Gaussian process.
@@ -39,6 +44,7 @@ class Constant(Mean):
39
44
c : variable, array or integer
40
45
Constant mean value
41
46
"""
47
+
42
48
def __init__ (self , c = 0 ):
43
49
Mean .__init__ (self )
44
50
self .c = c
@@ -58,6 +64,7 @@ class Linear(Mean):
58
64
intercept : variable, array or integer
59
65
Intercept for linear function (Defaults to zero)
60
66
"""
67
+
61
68
def __init__ (self , coeffs , intercept = 0 ):
62
69
Mean .__init__ (self )
63
70
self .b = intercept
You can’t perform that action at this time.
0 commit comments