#/usr/bin/bash

datadir='data/__new/lobby_fovea_r360x80_t1.0'
trainset='data/__new/lobby_fovea_r360x80_t1.0/train1.json'
testset='data/__new/lobby_fovea_r360x80_t1.0/test1.json'
epochs=50

n_nets=$1
nf=$2
n_layers=$3

configid="eval@snerffast${n_nets}-rgb_e6_fc${nf}x${n_layers}_d1.20-6.00_s64_~p"
if [ ! -f "$datadir/$configid/model-epoch_$epochs.pth" ]; then
    cont_epoch=0
    for ((i=$epochs-1;i>0;i--)) do
        if [ -f "$datadir/$configid/model-epoch_$i.pth" ]; then
            cont_epoch=$i
            break
        fi
    done
    if [ ${cont_epoch} -gt 0 ]; then
        python run_spherical_view_syn.py $trainset -e $epochs -m $configid/model-epoch_${cont_epoch}.pth
    else
        python run_spherical_view_syn.py $trainset -i $configid -e $epochs
    fi
fi
if ! ls $datadir/$configid/output_$epochs/perf_* >/dev/null 2>&1; then
    python run_spherical_view_syn.py $trainset -t -m $configid/model-epoch_$epochs.pth -o perf
    python run_spherical_view_syn.py $testset -t -m $configid/model-epoch_$epochs.pth -o perf
fi