Beispiel #1
0
    def __init__(self, input_dim, output_dim, active_dims=None):
        Kernel.__init__(self, active_dims)
        self.input_dim = input_dim
        self.output_dim = output_dim

        noise = np.random.random((output_dim))
        self.noise = gpflow.Parameter(noise,
                                      transform=gpflow.utilities.positive(),
                                      name="noise")
Beispiel #2
0
 def __init__(self, base_kern, branchPtTensor, b, fDebug=False):
     ''' branchPtTensor is tensor of branch points of size F X F X B where F the number of
     functions and B the number of branching points '''
     Kernel.__init__(self, input_dim=base_kern.input_dim + 1)
     self.kern = base_kern
     self.fm = branchPtTensor
     self.fDebug = fDebug
     assert isinstance(b, np.ndarray)
     assert self.fm.shape[0] == self.fm.shape[1]
     assert self.fm.shape[2] > 0
     self.Bv = DataHolder(b)
Beispiel #3
0
 def __init__(self,
              input_dim,
              variance=1.0,
              frequency=np.array([1.0, 1.0]),
              lengthscale=1.0,
              correlation=0.0,
              max_freq=1.0,
              active_dims=None):
     assert (input_dim == 1
             )  # the derivations are valid only for one dimensional input
     Kernel.__init__(self, input_dim=input_dim, active_dims=active_dims)
     self.variance = Param(variance, transforms.positive)
     self.frequency = Param(frequency, transforms.Logistic(0.0, max_freq))
     self.lengthscale = Param(lengthscale, transforms.positive)
     correlation = np.clip(correlation, 1e-4,
                           1 - 1e-4)  # clip for numerical reasons
     self.correlation = Param(correlation, transforms.Logistic())
Beispiel #4
0
    def __init__(self,
                 base_kern,
                 len_seqs,
                 len_windows,
                 num_features,
                 normalized=True):
        Kernel.__init__(self, len_seqs * num_features)
        self.len_seqs = len_seqs
        self.len_windows = len_windows
        self.base_kern = base_kern
        self.num_features = num_features

        self.normalized = normalized

        self.variance = Parameter(1.0,
                                  transform=transforms.positive,
                                  dtype=settings.float_type)

        if self.base_kern.input_dim != len_windows * num_features:
            raise ValueError(
                "Base_kern input dimensions must be consistent with window length."
            )
Beispiel #5
0
 def __init__(self, base_kern):
     Kernel.__init__(self, input_dim=base_kern.input_dim + 1)
     self.kern = base_kern
Beispiel #6
0
 def __init__(self, input_dim, output_dim, active_dims=None, name=None):
     Kernel.__init__(self, active_dims, name)
     self.input_dim = input_dim
     self.output_dim = output_dim