File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ # Kernel functions
2+ # Steven Atkinson
3+ # satkinso@nd.edu
4+ # February 21, 2018
5+
6+ import gpflow .kernels
7+
8+
9+ def turn_off_variances (kern_list , from_outside = True ):
10+ """
11+ Ensure that we don't have redundant variance parameters to optimize.
12+ THIS DOESN'T WORK VERY WELL! WATCH OUT IF YOUR KERNELS ARE CRAZY!
13+ :param kern_list: list of kernels
14+ :param top: whether this is the top layer of the kernel (called from outside)
15+ :return: (done by reference)
16+ """
17+
18+ if from_outside :
19+ kern_list = kern_list [1 :]
20+ for kern in kern_list :
21+ if isinstance (kern , gpflow .kernels .Combination ):
22+ turn_off_variances (kern .kern_list , False )
23+ elif hasattr (kern , "variance" ):
24+ kern .variance .set_trainable (False )
You can’t perform that action at this time.
0 commit comments