-
Notifications
You must be signed in to change notification settings - Fork 18
/
run_invert.sh
executable file
·52 lines (37 loc) · 1.09 KB
/
run_invert.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
#!/bin/bash
MODEL=${1:-church}
# First, train an encoder.
python -m seeing.train_multilayer_inv --model=${MODEL}
for LAYER in $(seq 4); do
python -m seeing.train_onelayer_inv --invert_layer=${LAYER} --model=${MODEL}
done
python -m seeing.train_hybrid_inv --model=${MODEL}
# Wait for individual layers to be encoded
until [[ -f results/${MODEL}/invert_over5_resnet/done.txt && \
-f results/${MODEL}/invert_layer_1_cse/done.txt && \
-f results/${MODEL}/invert_layer_2_cse/done.txt && \
-f results/${MODEL}/invert_layer_3_cse/done.txt && \
-f results/${MODEL}/invert_layer_4_cse/done.txt ]]
do
sleep 5
done
# And do 200 train, val and GAN-generated images.
for IMAGENUM in $(seq 0 199)
do
for SOURCE in train val gan
do
python -m seeing.optimize_residuals \
--image_number ${IMAGENUM} \
--image_source ${SOURCE} \
--model ${MODEL}
done
done
# And do 1000 training images.
for IMAGENUM in $(seq 200 999)
do
SOURCE=train
python -m seeing.optimize_residuals \
--image_number ${IMAGENUM} \
--image_source ${SOURCE} \
--model ${MODEL}
done