Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Added symmetry-breaking init in rbf #42

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion jaxkern/stationary/rbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ def __call__(
return K.squeeze()

def init_params(self, key: KeyArray) -> Dict:
eps = 1e-3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for 1e-3. I’d personally like the jitter to be as small as possible.

random_jitter = jax.random.uniform(key, shape=[self.ndims], minval=-eps, maxval=eps)
params = {
"lengthscale": jnp.array([1.0] * self.ndims),
"lengthscale": jnp.array([1.0] * self.ndims) + random_jitter,
"variance": jnp.array([1.0]),
}
return jax.tree_util.tree_map(lambda x: jnp.atleast_1d(x), params)