Skip to content

Commit

Permalink
add scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ghliu committed Dec 1, 2023
1 parent 7d23acb commit eb22dd3
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,8 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

#
data/*
results/*
.log/*
27 changes: 27 additions & 0 deletions scripts/download_img_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

DATASET=$1

echo "Note: available dataset are ffhq, afhqv2 "
echo "Specified [$DATASET]"

if [ "$DATASET" == afhqv2 ]; then
# afhqv2-64x64.zip
gdown -O data/ 17mH2b3oQ1CjqNshDBqZWapFoZbl2Rcpy

# 3x64x64 orthobasis
gdown -O data/ 1JYm8O46Y2bZOySDghyODp0ud-5lZcKnc

# network (VP, uncond)
gdown -O data/ 1A1upwcOmLfcHV0j4n2Fa8rtOnSVcotmh
fi

if [ "$DATASET" == ffhq ]; then
# ffhq-64x64.zip
gdown -O data/ 1NQ40CmBxFiAkd2SoWUTbhmm3VAyWVerF

# 3x64x64 orthobasis
gdown -O data/ 1JYm8O46Y2bZOySDghyODp0ud-5lZcKnc

# network (VP, uncond)
gdown -O data/ 1nz2M3gn-CbQ2z2_oKRSA5M_VwQzrtXdt
fi
21 changes: 21 additions & 0 deletions scripts/train_constr_gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ball
python train_constr_gen.py --constraint ball --xdim 2 --p0 moon --name moon
python train_constr_gen.py --constraint ball --xdim 2 --p0 spiral --name spiral
python train_constr_gen.py --constraint ball --xdim 2 --p0 gmm --name gmm
python train_constr_gen.py --constraint ball --xdim 6 --p0 gmm_nd --name gmm6d
python train_constr_gen.py --constraint ball --xdim 8 --p0 gmm_nd --name gmm8d
python train_constr_gen.py --constraint ball --xdim 20 --p0 gmm_nd --name gmm20d --num-itr 100000

# simplex
python train_constr_gen.py --constraint simplex --xdim 2 --p0 dirichlet1 --name simplex3d
python train_constr_gen.py --constraint simplex --xdim 2 --p0 dirichlet2 --name simplex3dv2
python train_constr_gen.py --constraint simplex --xdim 6 --p0 dirichlet3 --name simplex7d
python train_constr_gen.py --constraint simplex --xdim 8 --p0 dirichlet4 --name simplex9d
python train_constr_gen.py --constraint simplex --xdim 19 --p0 dirichlet_nd --name simplex20d --num-itr 100000

# cube
python train_constr_gen.py --constraint cube --xdim 2 --p0 cube --name cube2d
python train_constr_gen.py --constraint cube --xdim 3 --p0 cube --name cube3d
python train_constr_gen.py --constraint cube --xdim 6 --p0 cube --name cube6d
python train_constr_gen.py --constraint cube --xdim 8 --p0 cube --name cube8d
python train_constr_gen.py --constraint cube --xdim 20 --p0 cube --name cube20d --num-itr 100000
20 changes: 20 additions & 0 deletions scripts/train_img.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
DATASET=$1

echo "Note: available dataset are ffhq, afhqv2 "
echo "Specified [$DATASET]"

# these arguments should NOT be modified unless pretrain models change
AFHQv2="--pretrain=data/edm-afhqv2-64x64-uncond-vp.pt --cond=0 --arch=ddpmpp --batch=256 --cres=1,2,2,2 --lr=2e-4 --dropout=0.25 --augment=0.15"
FFHQ=" --pretrain=data/edm-ffhq-64x64-uncond-vp.pt --cond=0 --arch=ddpmpp --batch=256 --cres=1,2,2,2 --lr=2e-4 --dropout=0.05 --augment=0.15"

# `batch-gpu` is the maximum batch per gpu. **Current values are tuend on TITAN RTX**
# `snap` controls the frequency (in kimg) of saving network snapshot
# `dump` controls the frequency (in kimg) of dumpping training stats

if [ "$DATASET" == afhqv2 ]; then
python train_watermark.py --data=data/afhqv2-64x64.zip --outdir=results $AFHQv2 --batch-gpu=64 --snap=20 --dump=20
fi

if [ "$DATASET" == ffhq ]; then
python train_watermark.py --data=data/ffhq-64x64.zip --outdir=results $FFHQ --batch-gpu=64 --snap=10 --dump=10
fi

0 comments on commit eb22dd3

Please sign in to comment.