-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate_latent_spaces.sh
executable file
·90 lines (72 loc) · 2.63 KB
/
generate_latent_spaces.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
#!/bin/bash -l
# ----------------------------------------------------------------------------
# generate_latent_spaces.sh
# Author: Antoine Beauchamp
#
# This script generates 500 gene expression latent spaces by repeatedly
# training the multi-layer perceptron neural network and using the network
# architecture to transform the input space into the latent space.
source activate_venv.sh
datadir=data/
# datadir=data/isocortex/
outdir=data/MLP_outcomes/
# outdir=data/MLP_outcomes_isocortex/
if [ ! -d "$outdir" ]; then
mkdir -p "$outdir"
fi
niterations=500
nunits=200
L2=0.0
nepochs=150
totalsteps=200
learningrate=1e-05
optimizer=AdamW
confusionmatrix=false
voxeltransform=true
integratedgrads=false
for i in $(seq 1 $niterations);
do
echo "Iteration $i"
python3 train_multilayer_perceptron.py \
--datadir $datadir \
--outdir $outdir \
--labels region67 \
--mousedata region67 \
--humandata region88 \
--nunits $nunits \
--L2 $L2 \
--nepochs $nepochs \
--totalsteps $totalsteps \
--optimizer $optimizer \
--learningrate $learningrate \
--confusionmatrix $confusionmatrix \
--voxeltransform $voxeltransform \
--integratedgrads $integratedgrads \
--seed $i
mv ${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_HumanProb_Region88.csv \
${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_HumanProb_Region88_$i.csv
mv ${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_HumanTx_Region88.csv \
${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_HumanTx_Region88_$i.csv
mv ${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_MouseProb_Region67.csv \
${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_MouseProb_Region67_$i.csv
mv ${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_MouseTx_Region67.csv \
${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_MouseTx_Region67_$i.csv
if [ $confusionmatrix = 'true' ];
then
mv ${outdir}MLP_ConfusionMatrix_Training_Region67_Layers3_Units${nunits}_L2${L2}.csv \
${outdir}MLP_ConfusionMatrix_Training_Region67_Layers3_Units${nunits}_L2${L2}_$i.csv
fi
if [ $voxeltransform = 'true' ];
then
mv ${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_MouseVoxelTx.csv \
${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_MouseVoxelTx_$i.csv
mv ${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_HumanVoxelTx.csv \
${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_HumanVoxelTx_$i.csv
fi
if [ $integratedgrads = 'true' ];
then
mv ${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_IntegratedGradients.csv \
${outdir}MLP_Region67_Layers3_Units${nunits}_L2${L2}_IntegratedGradients_$i.csv
fi
done
deactivate