Skip to content

Commit

Permalink
Merge pull request #883 from marrlab/num_batches_est_ratio
Browse files Browse the repository at this point in the history
unit test number batches for estimate loss raiot
  • Loading branch information
smilesun authored Oct 10, 2024
2 parents 0033cd2 + d9eb780 commit 8ea9aa2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/sh_list_error.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# find $1 -type f -print0 | xargs -0 grep -li error
# # B means before, A means after, some erros have long stack exception message so we need at least
# # 100 lines before the error, the last line usually indicate the root cause of error
grep -B 100 -wnr "error" --group-separator="=========begin_slurm_error===============" $1 > slurm_errors.txt
cat slurm_errors.txt
24 changes: 24 additions & 0 deletions tests/test_number_batches_loss_ratio_estimate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
loss ratio estimate
"""
from tests.utils_test import utils_test_algo


def test_loss_ratio_estimate0():
"""
test different number of batches
"""
args = "--te_d=0 --tr_d 2 4 --task=mnistcolor10 --debug --bs=8 \
--model=erm --trainer=mldg --nname=conv_bn_pool_2 \
--nb4reg_over_task_ratio=0"
utils_test_algo(args)


def test_loss_ratio_estimate100():
"""
test different number of batches
"""
args = "--te_d=0 --tr_d 2 4 --task=mnistcolor10 --debug --bs=8 \
--model=erm --trainer=mldg --nname=conv_bn_pool_2 \
--nb4reg_over_task_ratio=100"
utils_test_algo(args)

0 comments on commit 8ea9aa2

Please sign in to comment.