Skip to content

Commit 2da8916

Browse files
committed
update: test_emcmc
1 parent 65e1159 commit 2da8916

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_utils.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
neuron_norm,
2323
normalize_gradient,
2424
reduce_max_except_dim,
25+
reg_noise,
2526
to_real,
2627
unit_norm,
2728
)
@@ -228,3 +229,13 @@ def test_max_reduce_except_dim():
228229
x = torch.zeros((1, 1))
229230
with pytest.raises(ValueError):
230231
reduce_max_except_dim(x, 3)
232+
233+
234+
def test_emcmc():
235+
torch.random.manual_seed(42)
236+
237+
network1 = Example()
238+
network2 = Example()
239+
240+
loss = reg_noise(network1, network2, int(5e4), 1e-1).detach().numpy()
241+
np.testing.assert_almost_equal(loss, 0.0011383)

0 commit comments

Comments
 (0)