MCPcopy Create free account
hub / github.com/COLA-Laboratory/TransOPT / __init__

Method __init__

transopt/optimizer/model/utils.py:89–111  ·  view source on GitHub ↗

Initialize the kernel. Args: input_dim: Input dimension of the training data. covariance_matrix: The fixed covariance matrix. active_dims: Active dimensions. name: Name of the kernel.

(
        self,
        input_dim: int,
        covariance_matrix: np.ndarray,
        active_dims: List[int] = None,
        name="PosteriorCov",
    )

Source from the content-addressed store, hash-verified

87 """
88
89 def __init__(
90 self,
91 input_dim: int,
92 covariance_matrix: np.ndarray,
93 active_dims: List[int] = None,
94 name="PosteriorCov",
95 ):
96 """Initialize the kernel.
97
98 Args:
99 input_dim: Input dimension of the training data.
100 covariance_matrix: The fixed covariance matrix.
101 active_dims: Active dimensions.
102 name: Name of the kernel.
103 """
104 super(FixedKernel, self).__init__(
105 input_dim=input_dim,
106 variance=1.0,
107 covariance_matrix=covariance_matrix,
108 active_dims=active_dims,
109 name=name,
110 )
111 self.variance.fix()
112
113 def to_dict(self) -> dict:
114 """Save the kernel as a dictionary."""

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected