Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed Oct 8, 2021
1 parent c1a551f commit f484f2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mlkernels/kernels/ceq.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def __init__(self, alpha):
def _compute(self, dists):
return (1 - B.erf(self.alpha * dists / 4)) * B.exp(-0.5 * dists ** 2)

def render(self, formatter):
return f"CEQ({formatter(self.alpha)})"

@property
def _stationary(self):
return True
Expand Down
2 changes: 1 addition & 1 deletion tests/kernels/test_ceq.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_eq():
# Verify that the kernel has the right properties.
assert k.alpha == 1.0
assert k.stationary
assert str(k) == "CEQ()"
assert str(k) == "CEQ(1.0)"

# Test equality.
assert CEQ(1.0) == CEQ(1.0)
Expand Down

0 comments on commit f484f2c

Please sign in to comment.