diff --git a/scripts/sh_list_error.sh b/scripts/sh_list_error.sh new file mode 100644 index 000000000..cd0c01bef --- /dev/null +++ b/scripts/sh_list_error.sh @@ -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 diff --git a/tests/test_number_batches_loss_ratio_estimate.py b/tests/test_number_batches_loss_ratio_estimate.py new file mode 100644 index 000000000..70d662c52 --- /dev/null +++ b/tests/test_number_batches_loss_ratio_estimate.py @@ -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)