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, mu=None, lengthscale=None, signal_variance=None): mu = np.zeros(1) if mu is None else mu lengthscale = 0.2 * np.ones(1) if lengthscale is None else lengthscale signal_variance = 3 * np.ones( 1) if signal_variance is None else signal_variance MeanFunction.__init__(self) self.signal_variance = Param(signal_variance, transforms.positive) self.lengthscale = Param(lengthscale, transforms.positive) self.mu = Param(mu)
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 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, 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, W, b, trainable=False): MeanFunction.__init__(self) self.W = Parameter(W, trainable=trainable) self.b = Parameter(b, trainable=trainable) self.trainable = trainable
def __init__(self, alpha=1): MeanFunction.__init__(self) self.alpha = Parameter(alpha, dtype=settings.float_type)
def __init__(self): MeanFunction.__init__(self)
def __init__(self, A=None, mu=None): A = np.ones(1) if A is None else A mu = np.zeros(1) if mu is None else mu MeanFunction.__init__(self) self.A = Param(A) self.mu = Param(mu)