Skip to content

Commit

Permalink
changed tolerances
Browse files Browse the repository at this point in the history
  • Loading branch information
ricsinaruto committed Mar 27, 2023
1 parent ddc40f4 commit 472b7ca
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/test_lda_nn_chn_multiclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# assert that losses are the same as true_losses to 4 decimal places
for loss, val in zip(losses, true_losses):
assert round(loss, 2) == round(val, 2)
assert abs(loss-val) < 0.005

# check that model.pt25 exists
path = os.path.join(directory, 'model.pt25')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lda_nn_fe_multiclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
loss = float(lines[0].strip())

# assert that loss is the same as val to 4 decimal places
assert round(loss, 2) == round(val, 2)
assert abs(loss-val) < 0.005

# check that model.pt25 exists
path = os.path.join(directory, 'model.pt25')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lda_nn_fe_multiclass2pairwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
loss = float(lines[0].strip())

# assert that loss is the same as val to 4 decimal places
assert round(loss, 2) == round(val, 2)
assert abs(loss-val) < 0.005
2 changes: 1 addition & 1 deletion tests/test_lda_nn_fe_multiclass_spatialPFI.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# assert that pfi is the same as true_pfi to 4 decimal places
# use numpy
assert np.allclose(pfi, true_pfi, rtol=1e-05, atol=1e-08)
assert np.allclose(pfi, true_pfi, rtol=0.02, atol=0.002)

# assert that args_saved.py is same as args.py
with open('args.py', 'r') as f:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lda_nn_fe_multiclass_spatiotemporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# assert that pfi is the same as true_pfi to 4 decimal places
# use numpy
assert np.allclose(pfi, true_pfi, rtol=1e-05, atol=1e-08)
assert np.allclose(pfi, true_pfi, rtol=0.02, atol=0.002)

# assert that args_saved.py is same as args.py
with open('args.py', 'r') as f:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lda_nn_fe_multiclass_spectralPFI.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# assert that pfi is the same as true_pfi to 4 decimal places
# use numpy
assert np.allclose(pfi, true_pfi, rtol=1e-05, atol=1e-08)
assert np.allclose(pfi, true_pfi, rtol=0.02, atol=0.002)

# assert that args_saved.py is same as args.py
with open('args.py', 'r') as f:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lda_nn_fe_multiclass_temporalPFI.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# assert that pfi is the same as true_pfi to 4 decimal places
# use numpy
assert np.allclose(pfi, true_pfi, rtol=1e-05, atol=1e-08)
assert np.allclose(pfi, true_pfi, rtol=0.02, atol=0.002)


# assert that args_saved.py is same as args.py
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lda_nn_fe_multiclass_temporospectralPFI.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# assert that pfi is the same as true_pfi to 4 decimal places
# use numpy
assert np.allclose(pfi, true_pfi, rtol=1e-05, atol=1e-08)
assert np.allclose(pfi, true_pfi, rtol=0.02, atol=0.002)

# assert that args_saved.py is same as args.py
with open('args.py', 'r') as f:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lda_nn_sw_multiclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# assert that losses are the same as true_losses to 4 decimal places
for loss, val in zip(losses, true_losses):
assert round(loss, 2) == round(val, 2)
assert abs(loss-val) < 0.005

# check that model.pt5 ... model.pt105 exists
for i in range(5, 105):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# assert that loss is the same as val to 4 decimal places
for k in keys:
assert round(float(d[k]), 2) == round(float(values[k]), 2)
assert abs(float(d[k])-float(values[k])) < 0.005

# check that model.pt exists
for n in ['_end', '_epoch', '_init', '']:
Expand Down

0 comments on commit 472b7ca

Please sign in to comment.