-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate.sh
executable file
·49 lines (41 loc) · 1.71 KB
/
validate.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
#!/usr/bin/env bash
#$ -l mem_free=10G
#$ -l ram_free=10G
#$ -cwd
if [ $# -le 2 ]; then
echo "Usage :"
echo "./validate.sh <CLASS> <experiment_dir> <protocol> <OPTIONAL protocol_train> <OPTION precision>"
echo "<CLASS> needs to be in [KCHI, CHI, FEM, MAL, speech]"
echo "<protocol> is the protocol on which the model will be validating"
echo "<protocol_train> is the name of the protocol on which the model was trained (if not specified, assuming it's the same one as <protocol>)"
echo "<precision> specifies the fixed precision for validation. If not specified, assumes 0.8"
echo "Example :"
echo "export EXPERIMENT_DIR=babytrain/multilabel"
echo "sbatch validate.sh speech ${EXPERIMENT_DIR} BabyTrain.SpeakerRole.JSALT X.SpeakerRole.JSALT 0.5"
exit
fi
CLASS=$1
experiment_dir=$2
protocol=$3
protocol_train=$4
precision=$5
# if no protocol_train given, assume the validation protocol is the same as the one used for training
if [[ ! $protocol_train ]]; then
echo "assuming you're validating on same protocol as train..."
protocol_train=$protocol;
fi
# if no precision, use 0.8
if [[ ! $precision ]]; then
precision=0.8
fi
if [[ ! $CLASS =~ ^(KCHI|CHI|FEM|MAL|SPEECH)$ ]]; then
echo "The first parameter must belong to [KCHI,CHI,FEM,MAL,speech]."
exit
fi
source activate pyannote
export EXPERIMENT_DIR=$experiment_dir
export TRAIN_DIR=${EXPERIMENT_DIR}/train/${protocol_train}.train
# copy database.yml in output folder to keep trace of what was used when launching the experiment
mkdir -p $TRAIN_DIR/validate_$CLASS
cp -r $HOME/.pyannote/database.yml $TRAIN_DIR/validate_$CLASS/
pyannote-multilabel validate --precision=$precision --to=100 --every=1 $CLASS ${TRAIN_DIR} $protocol