-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpretrain.sh
executable file
·53 lines (48 loc) · 1.34 KB
/
pretrain.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
#!/bin/bash
# Usage: bash ./scripts/pretrain.sh <codebook_size> <dim_model>
# IMPORTANT: Make sure to change the data_root to your own path.
# For debugging, add the flag "--dev" to the end of the command.
codebook_size=$1
dim_model=$2
data_root=~/data/VQShape
python ./vqshape/pretrain.py \
--data_root $data_root \
--dim_embedding $dim_model \
--normalize_length 512 \
--patch_size 8 \
--num_patch 64 \
--num_token 64 \
--num_transformer_enc_heads 8 \
--num_transformer_enc_layers 4 \
--num_tokenizer_heads 8 \
--num_tokenizer_layers 4 \
--num_transformer_dec_heads 8 \
--num_transformer_dec_layers 2 \
--num_code $codebook_size \
--dim_code 8 \
--codebook_type standard \
--len_s 128 \
--s_smooth_factor 1 \
--lambda_x 1 \
--lambda_z 1 \
--lambda_s 1 \
--lambda_dist 0.8 \
--lambda_vq_commit 0.25 \
--lambda_vq_entropy 0.1 \
--entropy_gamma 1 \
--lr 1e-4 \
--batch_size 512 \
--accumulate_grad_batches 4 \
--gradient_clip 1 \
--weight_decay 0.01 \
--mask_ratio 0.25 \
--warmup_step 1000 \
--train_epoch 2 \
--val_frequency 0.2 \
--name uea_dim"$dim_model"_codebook"$codebook_size" \
--num_nodes 1 \
--num_devices 1 \
--strategy "auto" \
--precision "bf16-mixed" \
--num_workers 8 \
--balance_datasets