-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.7 | ||
1.0.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from gs_divergence.geodesical_skew_divergence import gs_div | ||
from gs_divergence.symmetrized_geodesical_skew_divergence import symmetrized_gs_div | ||
|
||
__version__ = '1.0.7' | ||
__version__ = '1.0.8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import unittest | ||
import torch | ||
|
||
from gs_divergence import gs_div | ||
|
||
|
||
class TestGSDiv(unittest.TestCase): | ||
def test_alpha_minus_1(self): | ||
a = torch.Tensor([1, 2, 3]) | ||
b = torch.Tensor([4, 5, 6]) | ||
g = gs_div(a, b, alpha=-1, lmd=0.5) | ||
|
||
self.assertIsNotNone(g) | ||
|
||
def test_value_0_2d(self): | ||
a = torch.Tensor([[0.1, 0.2, 0.7], [0.5, 0.5, 0.0]]) | ||
b = torch.Tensor([[0.4, 0.4, 0.2], [0.2, 0.1, 0.7]]) | ||
|
||
g = gs_div(a, b, alpha=1, lmd=0.5) | ||
|
||
self.assertTrue(torch.isinf(g).sum() == 0) |