-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathunit_test.sh
executable file
·95 lines (78 loc) · 2.63 KB
/
unit_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
seed=0
# Test on a small number of samples per task
ROT="--n_layers 2 --n_hiddens 100 --data_path data/ --save_path results/ --batch_size 1 --log_every 100 --samples_per_task 10 --data_file mnist_rotations.pt --cuda no --seed"
echo "Begin Unit Test with seed =" $seed " on MNIST Rotations"
echo "Testing Online"
python3 main.py $ROT $seed --model online --lr 0.0003
if [ $? -eq 0 ]
then
echo "Online finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Testing Independent"
python3 main.py $ROT $seed --model independent --lr 0.01
if [ $? -eq 0 ]
then
echo "Independent finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Testing EWC"
python3 main.py $ROT $seed --model ewc --lr 0.001 --n_memories 10 --memory_strength 100.0
if [ $? -eq 0 ]
then
echo "EWC finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Testing GEM"
python3 main.py $ROT $seed --model gem --lr 0.01 --n_memories 256 --memory_strength 1.0
if [ $? -eq 0 ]
then
echo "GEM finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Testing eralg4"
python3 main.py $ROT $seed --model eralg4 --lr 0.1 --memories 5120 --replay_batch_size 25
if [ $? -eq 0 ]
then
echo "eralg4 finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Testing eralg5"
python3 main.py $ROT $seed --model eralg5 --lr 0.03 --memories 5120 --replay_batch_size 100
if [ $? -eq 0 ]
then
echo "eralg5 finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Testing meralg1"
python3 main.py $ROT $seed --model meralg1 --lr 0.03 --beta 0.03 --gamma 1.0 --memories 5120 --replay_batch_size 100 --batches_per_example 10
if [ $? -eq 0 ]
then
echo "meralg1 finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Testing meralg6"
python3 main.py $ROT $seed --model meralg6 --lr 0.03 --gamma 0.1 --memories 5120 --replay_batch_size 100
if [ $? -eq 0 ]
then
echo "meralg6 finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Testing meralg7"
python3 main.py $ROT $seed --model meralg7 --lr 0.03 --gamma 0.03 --memories 500 --replay_batch_size 50 --s 5
if [ $? -eq 0 ]
then
echo "meralg7 finished successfully"
else
echo "Exited with error." >&2 # Redirect stdout from echo command to stderr.
fi
echo "Finished"