Skip to content

Commit

Permalink
Fix cayley_loss function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Hale committed Jul 25, 2024
1 parent 0979ea6 commit 799419e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="sgw_tools",
version="3.1",
version="3.1.1",
author="Mark Hale",
license="MIT",
description="Spectral graph wavelet tools",
Expand Down
3 changes: 1 addition & 2 deletions sgw_tools/approximations.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,4 @@ def cayley_loss(h, f, m):
z = util.cayley_transform(h*G.e)
y = f.evaluate(G.e).squeeze()
p = np.polynomial.polynomial.Polynomial.fit(z, y, m, domain=[0, G.lmax], window=[0, G.lmax])
p.coef[0] = np.real(p.coef[0])
return np.linalg.norm(y - p(z))
return np.linalg.norm(y - p(z).real)

0 comments on commit 799419e

Please sign in to comment.