def __init__(self, input_dim, locs_poi, typeIndicator, active_dims=None, name=None, typIdx=1, lengthscale=None, effects=None, locs=None, mindist=0.5, kernel_type="linear"): super().__init__(input_dim, active_dims, name=name) effects = np.random.uniform(low=0.5, high=1.0) if effects is None else effects MeanFunction.__init__(self) self.locs_poi = locs_poi.astype(np.float64) self.typeIndicator = typeIndicator.astype(np.float64) self.typIdx = typIdx self.locs_poi_j = self.locs_poi[self.typeIndicator[:, self.typIdx] == 1, :] self.kernel_type = kernel_type self.lengthscale = 0 #Parameter(2, transform=transforms.Logistic(a=mindist, b=10), dtype=settings.float_type) self.effects = Parameter(effects, transform=transforms.Logistic(a=0.01, b=1), dtype=settings.float_type) self.distmax = Parameter(0.5, transform=transforms.Logistic(a=0, b=1.5), dtype=settings.float_type)
def __init__(self, p=None): """ A is a matrix which maps each element of X to Y, b is an additive constant. If X has N rows and D columns, and Y is intended to have Q columns, then A must be D x Q, b must be a vector of length Q. """ MeanFunction.__init__(self) self.p = p weights1 = np.random.rand(p, 4) weights2 = np.random.rand(4, 1) self.weights1 = Parameter(weights1, dtype=settings.float_type) self.weights2 = Parameter(weights2, dtype=settings.float_type)
def __init__(self, A=None, p=None): """ A is a matrix which maps each element of X to Y, b is an additive constant. If X has N rows and D columns, and Y is intended to have Q columns, then A must be D x Q, b must be a vector of length Q. """ A = np.ones((1, 1)) if A is None else A MeanFunction.__init__(self) self.A = Parameter(np.atleast_2d(A), dtype=settings.float_type) self.p = p
def __init__(self, p=None): """ A is a matrix which maps each element of X to Y, b is an additive constant. If X has N rows and D columns, and Y is intended to have Q columns, then A must be D x Q, b must be a vector of length Q. """ MeanFunction.__init__(self) self.p = p hidden_units = 8 bias1 = 1 bias2 = 1 weights1 = np.zeros((p, hidden_units)) weights2 = np.zeros((hidden_units, 1)) self.weights1 = Parameter(weights1, dtype=settings.float_type) self.weights2 = Parameter(weights2, dtype=settings.float_type) self.bias1 = Parameter(bias1, dtype=settings.float_type) self.bias2 = Parameter(bias2, dtype=settings.float_type)
def __init__(self, invlink=tf.exp, scale=1., **kwargs): super().__init__(**kwargs) self.invlink = invlink self.scale = Parameter(scale, transform=transforms.positive, dtype=settings.float_type)