mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-14 14:32:37 +02:00
added constructor for hierarchical kernel
This commit is contained in:
parent
d887e1ceda
commit
f19a26a006
3 changed files with 11 additions and 1 deletions
|
|
@ -298,3 +298,12 @@ def independent_outputs(k):
|
||||||
assert (sl.start is None) and (sl.stop is None), "cannot adjust input slices! (TODO)"
|
assert (sl.start is None) and (sl.stop is None), "cannot adjust input slices! (TODO)"
|
||||||
_parts = [parts.independent_outputs.IndependentOutputs(p) for p in k.parts]
|
_parts = [parts.independent_outputs.IndependentOutputs(p) for p in k.parts]
|
||||||
return kern(k.input_dim+1,_parts)
|
return kern(k.input_dim+1,_parts)
|
||||||
|
|
||||||
|
def hierarchical(k):
|
||||||
|
"""
|
||||||
|
Construct a kernel with independent outputs from an existing kernel
|
||||||
|
"""
|
||||||
|
# for sl in k.input_slices:
|
||||||
|
# assert (sl.start is None) and (sl.stop is None), "cannot adjust input slices! (TODO)"
|
||||||
|
_parts = [parts.hierarchical.Hierarchical(k.parts)]
|
||||||
|
return kern(k.input_dim+1,_parts)
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,4 @@ import rbf
|
||||||
import spline
|
import spline
|
||||||
import symmetric
|
import symmetric
|
||||||
import white
|
import white
|
||||||
|
import hierarchical
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from kernpart import Kernpart
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from independent_outputs import index_to_slices
|
from independent_outputs import index_to_slices
|
||||||
|
|
||||||
class hierarchical(Kernpart):
|
class Hierarchical(Kernpart):
|
||||||
"""
|
"""
|
||||||
A kernel part which can reopresent a hierarchy of indepencnce: a gerenalisation of independent_outputs
|
A kernel part which can reopresent a hierarchy of indepencnce: a gerenalisation of independent_outputs
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue