Commit 14008116 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Experiments

parent c81d9a9f
Pipeline #58976 failed with stages
in 2 minutes and 40 seconds
VGG_TYPE=mobio
BACKBONE=iresnet34
#./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/balance/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/balance/$VGG_TYPE/$BACKBONE/
#-l sge
BACKBONE=iresnet50
./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/balance/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/balance/$VGG_TYPE/$BACKBONE/ \
-l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/balance/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/balance/$VGG_TYPE/$BACKBONE/ \
-l sge
VGG_TYPE=vgg2-full
BACKBONE=iresnet34
#./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/balance/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/balance/$VGG_TYPE/$BACKBONE/
#-l sge
BACKBONE=iresnet50
#./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/balance/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/balance/$VGG_TYPE/$BACKBONE/ \
# -l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/balance/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/balance/$VGG_TYPE/$BACKBONE/ \
-l sge
VGG_TYPE=meds
BACKBONE=iresnet34
#./bin/bob bio demographics regularization-level-fairness meds $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
# -l sge
BACKBONE=iresnet50
./bin/bob bio demographics regularization-level-fairness meds $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
-l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness meds $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
-l sge
VGG_TYPE=mobio
BACKBONE=iresnet34
#./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
# -l sge
BACKBONE=iresnet50
#./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
# -l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
-l sge
VGG_TYPE=vgg2-short
BACKBONE=iresnet34
#./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
# -l sge
BACKBONE=iresnet50
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
-l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive/$VGG_TYPE/$BACKBONE/ \
-l sge
VGG_TYPE=meds
BACKBONE=iresnet34
#./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
# -l sge
BACKBONE=iresnet50
./bin/bob bio demographics regularization-level-fairness $VGG_TYPE $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
-l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness $VGG_TYPE $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
-l sge
VGG_TYPE=mobio
BACKBONE=iresnet34
#./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
# -l sge
BACKBONE=iresnet50
./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
-l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
-l sge
VGG_TYPE=vgg2-short
BACKBONE=iresnet34
#./bin/bob bio demographics regularization-level-fairness mobio $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
# -l sge
BACKBONE=iresnet50
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
-l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/model.pth \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/contrastive_orthogonality/$VGG_TYPE/$BACKBONE/ \
-l sge
BACKBONE=iresnet34
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/orthogonality/vgg2-short/$BACKBONE/last.ckpt \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/orthogonality/vgg2-short/$BACKBONE/ \
orthogonality -l sge
#BACKBONE=iresnet50
#./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/orthogonality/vgg2-short/$BACKBONE/last.ckpt \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/orthogonality/vgg2-short/$BACKBONE/ \
# orthogonality -l sge
#BACKBONE=iresnet100
#./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
# /idiap/temp/tpereira/2.FRDemographics/regularization/models/orthogonality/vgg2-short/$BACKBONE/last.ckpt \
# /idiap/temp/tpereira/2.FRDemographics/regularization/experiments/orthogonality/vgg2-short/$BACKBONE/ \
# orthogonality -l sge
BACKBONE=iresnet34
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/orthogonality/vgg2-full/$BACKBONE/last.ckpt \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/orthogonality/vgg2-full/$BACKBONE/ \
orthogonality -l sge
BACKBONE=iresnet50
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/orthogonality/vgg2-full/$BACKBONE/last.ckpt \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/orthogonality/vgg2-full/$BACKBONE/ \
orthogonality -l sge
BACKBONE=iresnet100
./bin/bob bio demographics regularization-level-fairness vgg2 $BACKBONE \
/idiap/temp/tpereira/2.FRDemographics/regularization/models/orthogonality/vgg2-full/$BACKBONE/last.ckpt \
/idiap/temp/tpereira/2.FRDemographics/regularization/experiments/orthogonality/vgg2-full/$BACKBONE/ \
orthogonality -l sge
BASE_PATH=/idiap/temp/tpereira/2.FRDemographics/regularization/models/balance/vgg2-short/
COMMAND=./bob/bio/demographics/script/train_regularization_level_fairness_commands.py
BACKBONE=iresnet34
jman submit --name B.IRESNET34 -q gpu -- ./bin/python $COMMAND $BASE_PATH/$BACKBONE \
-d ./bob/bio/demographics/config/train/databases/vgg2/vgg2-short.py \
-b ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
-h ./bob/bio/demographics/config/train/heads/arcface.py \
-t ./bob/bio/demographics/config/train/training_configs/regular_sgd_crossentropy.py
#jman submit --name B.IRESNET34 -q gpu -- ./bin/bob bio demographics train-regularization-level-fairness train-balance $BASE_PATH/$BACKBONE \
# -d ./bob/bio/demographics/config/train/databases/vgg2/vgg2-short.py \
# -b ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
# -h ./bob/bio/demographics/config/train/heads/arcface.py \
# -t ./bob/bio/demographics/config/train/training_configs/regular_sgd_crossentropy.py
BACKBONE=iresnet50
jman submit --name B.IRESNET50 -q gpu -- ./bin/python $COMMAND $BASE_PATH/$BACKBONE \
jman submit --name VGG2-B.IRESNET50 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-balance $BASE_PATH/$BACKBONE \
-d ./bob/bio/demographics/config/train/databases/vgg2/vgg2-short.py \
-b ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
-h ./bob/bio/demographics/config/train/heads/arcface.py \
-t ./bob/bio/demographics/config/train/training_configs/regular_sgd_crossentropy.py
-t ./bob/bio/demographics/config/train/training_configs/regular_sgd_crossentropy.py --head-epochs 5
BACKBONE=iresnet100
jman submit --name B.IRESNET100 -q gpu -- ./bin/python $COMMAND $BASE_PATH/$BACKBONE \
jman submit --name VGG2-B.IRESNET100 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-balance $BASE_PATH/$BACKBONE \
-d ./bob/bio/demographics/config/train/databases/vgg2/vgg2-short.py \
-b ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
-h ./bob/bio/demographics/config/train/heads/arcface.py \
-t ./bob/bio/demographics/config/train/training_configs/regular_sgd_crossentropy.py
-t ./bob/bio/demographics/config/train/training_configs/regular_sgd_crossentropy.py --head-epochs 5
BASE_PATH=/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/meds/
#COMMAND=./bob/bio/demographics/script/train_regularization_level_fairness_commands.py
BACKBONE=iresnet50
jman submit --name MEDS-C.IRESNET50 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-contrastive-independence \
$BASE_PATH/$BACKBONE \
--database ./bob/bio/demographics/config/train/databases/meds/meds.py \
--identity-backbone ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
--demographic-backbone-checkpoint /idiap/temp/tpereira/2.FRDemographics/regularization/models/demographic/meds/iresnet50/model.pth \
--demographic-backbone ./bob/bio/demographics/config/train/demographic_backbones/iresnet50.py \
--max-epochs 100 --batch-size 64 \
--max-positive-pairs-per-subject 20 --negative-pairs-per-subject 20
BACKBONE=iresnet100
jman submit --name MEDS.C.IRESNET100 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-contrastive-independence \
$BASE_PATH/$BACKBONE \
--database ./bob/bio/demographics/config/train/databases/meds/meds.py \
--identity-backbone ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
--demographic-backbone-checkpoint /idiap/temp/tpereira/2.FRDemographics/regularization/models/demographic/meds/iresnet50/model.pth \
--demographic-backbone ./bob/bio/demographics/config/train/demographic_backbones/iresnet50.py \
--max-epochs 100 --batch-size 64 \
--max-positive-pairs-per-subject 20 --negative-pairs-per-subject 20
BACKBONE=iresnet34
BASE_PATH=/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/mobio/
#COMMAND=./bob/bio/demographics/script/train_regularization_level_fairness_commands.py
BACKBONE=iresnet50
jman submit --name MOBIO-C.IRESNET50 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-contrastive-independence \
$BASE_PATH/$BACKBONE \
--database ./bob/bio/demographics/config/train/databases/mobio/mobio-male-female.py \
--identity-backbone ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
--demographic-backbone-checkpoint /idiap/temp/tpereira/2.FRDemographics/regularization/models/demographic/mobio/iresnet50/model.pth \
--demographic-backbone ./bob/bio/demographics/config/train/demographic_backbones/iresnet50.py \
--max-epochs 10 --batch-size 64 \
--max-positive-pairs-per-subject 20 --negative-pairs-per-subject 20
BACKBONE=iresnet100
jman submit --name MOBIO.C.IRESNET100 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-contrastive-independence \
$BASE_PATH/$BACKBONE \
--database ./bob/bio/demographics/config/train/databases/mobio/mobio-male-female.py \
--identity-backbone ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
--demographic-backbone-checkpoint /idiap/temp/tpereira/2.FRDemographics/regularization/models/demographic/mobio/iresnet50/model.pth \
--demographic-backbone ./bob/bio/demographics/config/train/demographic_backbones/iresnet50.py \
--max-epochs 10 --batch-size 64 \
--max-positive-pairs-per-subject 20 --negative-pairs-per-subject 20
BACKBONE=iresnet34
#jman submit --name C.IRESNET34 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]" -- ./bin/bob bio demographics train-regularization-level-fairness train-contrastive \
# $BASE_PATH/$BACKBONE \
# --database ./bob/bio/demographics/config/train/databases/mobio/mobio-male-female.py \
# --identity-backbone ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
# --training-config ./bob/bio/demographics/config/train/training_configs/regular_sgd_crossentropy.py \
# --max-epochs 50 --batch-size 128 \
# --max-positive-pairs-per-subject 20 --negative-pairs-per-subject 20
BASE_PATH=/idiap/temp/tpereira/2.FRDemographics/regularization/models/contrastive_orthogonality/vgg2-short/
#COMMAND=./bob/bio/demographics/script/train_regularization_level_fairness_commands.py
BACKBONE=iresnet50
jman submit --name VGG2-C.IND.IRESNET50 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-contrastive-independence \
$BASE_PATH/$BACKBONE \
--database ./bob/bio/demographics/config/train/databases/vgg2/vgg2-short-with-validation.py \
--identity-backbone ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
--demographic-backbone-checkpoint /idiap/temp/tpereira/2.FRDemographics/regularization/models/demographic/vgg2-short/iresnet50/model.pth \
--demographic-backbone ./bob/bio/demographics/config/train/demographic_backbones/iresnet50.py \
--max-epochs 5 --batch-size 64 \
--max-positive-pairs-per-subject 3 --negative-pairs-per-subject 2
BACKBONE=iresnet100
jman submit --name VGG2-C.IND.IRESNET100 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-contrastive-independence \
$BASE_PATH/$BACKBONE \
--database ./bob/bio/demographics/config/train/databases/vgg2/vgg2-short-with-validation.py \
--identity-backbone ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
--demographic-backbone-checkpoint /idiap/temp/tpereira/2.FRDemographics/regularization/models/demographic/vgg2-short/iresnet50/model.pth \
--demographic-backbone ./bob/bio/demographics/config/train/demographic_backbones/iresnet50.py \
--max-epochs 5 --batch-size 64 \
--max-positive-pairs-per-subject 3 --negative-pairs-per-subject 2
BACKBONE=iresnet34
......@@ -3,7 +3,7 @@ BASE_PATH=/idiap/temp/tpereira/2.FRDemographics/regularization/models/demographi
BACKBONE=iresnet34
jman submit --name VGG-D.IRESNET34 -q gpu -- ./bin/bob bio demographics train-regularization-level-fairness train-demographics $BASE_PATH/$BACKBONE \
jman submit --name VGG-D.IRESNET34 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-demographics $BASE_PATH/$BACKBONE \
-d ./bob/bio/demographics/config/train/databases/vgg2/vgg2-short-with-validation.py \
-b ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
-h ./bob/bio/demographics/config/train/demographic_heads/arcface.py \
......@@ -14,7 +14,7 @@ jman submit --name VGG-D.IRESNET34 -q gpu -- ./bin/bob bio demographics train-re
BACKBONE=iresnet50
jman submit --name VGG-D.IRESNET50 -q gpu -- ./bin/bob bio demographics train-regularization-level-fairness train-demographics $BASE_PATH/$BACKBONE \
jman submit --name VGG-D.IRESNET50 -q gpu --sge-extra-args="-l hostname=vgni001|vgni00[1-9]|vgni01[0-9]|vgni02[0-9]|vgni03[0-2]|vgnh00[1-8]|vgng00[1-8]|vgnf00[1-9]|vgnf01[1-6]" -- ./bin/bob bio demographics train-regularization-level-fairness train-demographics $BASE_PATH/$BACKBONE \
-d ./bob/bio/demographics/config/train/databases/vgg2/vgg2-short-with-validation.py \
-b ./bob/bio/demographics/config/train/backbones/$BACKBONE.py \
-h ./bob/bio/demographics/config/train/demographic_heads/arcface.py \
......
......@@ -6,5 +6,13 @@ from bob.bio.base.score.load import get_split_dataframe
def load(filename):
return get_split_dataframe(filename)
# return get_split_dataframe(filename)
import dask
# Chuncks of 100MB
df = dask.dataframe.read_csv(filename, 100 * 1024 * 1024)
genuines = df[df.probe_subject_id == df.bio_ref_subject_id]
impostors = df[df.probe_subject_id != df.bio_ref_subject_id]
return impostors, genuines
......@@ -9,6 +9,17 @@ import copy
import math
def switch(model, flag):
model.train(flag)
# model.requires_grad = flag
for p in model.parameters():
p.requires_grad = flag
return model
class SimpleBalanceModel(BackboneHeadModel):
"""
Trainer that trains using a balanced dataset
......@@ -19,9 +30,8 @@ class SimpleBalanceModel(BackboneHeadModel):
backbone=None,
identity_head=None,
loss_fn=None,
optimizer_fn=None,
backbone_checkpoint_file=None,
max_epochs=500,
head_epochs=2,
**kwargs,
):
# super(pl.LightningModule, self).__init__(**kwargs)
......@@ -30,25 +40,73 @@ class SimpleBalanceModel(BackboneHeadModel):
self.backbone = backbone
self.identity_head = identity_head
self.loss_fn = loss_fn
self.optimizer_fn = optimizer_fn
self.head_epochs = head_epochs
self.max_epochs = max_epochs
self.backbone_checkpoint_file = backbone_checkpoint_file
# self.last_op = None
# Control the networks that will be updated
self.head_switch = False
self.backbone_switch = False
# Important: This property activates manual optimization.
self.automatic_optimization = False
def define_step(self):
"""
Step 0: Trains the head only
Step 1: Trains the backbone only
"""
if self.current_epoch < self.head_epochs:
return 0
return 1
def training_step(self, batch, batch_idx):
head_opt, backbone_opt = self.optimizers()
data = batch["data"]
label = batch["label"]
# demography = batch["demography"]
step = self.define_step()
self.log("train/multitask_step", step)
if step == 0:
## First we learn the head
if not self.head_switch:
self.head_switch = True
self.backbone = switch(self.backbone, False)
else:
if not self.backbone_switch:
self.backbone_switch = True
self.backbone = switch(self.backbone, True)
# Embedding
embedding = self.backbone(data)
# Identity loss
logits_identiy = self.identity_head(embedding, label)
loss_identity = self.loss_fn(logits_identiy, label)
self.log("train/loss_identity", loss_identity)
# Updating the head and bacbone
head_opt.zero_grad()
backbone_opt.zero_grad()
self.manual_backward(loss_identity)
head_opt.step()
backbone_opt.step()
acc = (
sum(
......@@ -64,5 +122,8 @@ class SimpleBalanceModel(BackboneHeadModel):
return loss_identity
def configure_optimizers(self):