Skip to content

Commit

Permalink
final versions of scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphonsce committed Apr 22, 2024
1 parent 94ca232 commit 07e27cd
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 0 deletions.
49 changes: 49 additions & 0 deletions scripts/stable_sig_different_distr/METR-METR.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
TRAIN_DIR=generated_images/imgs_w
VAL_DIR=val_mock

CHECKPOINT_NAME=metr_metr
EVAL_PATH="$CHECKPOINT_NAME/imgs_w"

# Fine-tuning:

accelerate launch -m metr.finetune_ldm_decoder --num_keys 1 \
--ldm_config v2-inference.yaml \
--ldm_ckpt v2-1_512-ema-pruned.ckpt \
--msg_decoder_path dec_48b_whit.torchscript.pt \
--train_dir $TRAIN_DIR \
--val_dir $VAL_DIR \
--with_tracking \
--project_name finetune_ldm_decoder \
--run_name test \
--output_dir finetune_ldm_decoder \
--batch_size 4 \
--steps 50 \
--num_val_imgs 1 \
--not_rand_key \
--key_str 111010110101000001010111010011010100010000100111 \
--checkpoint_name $CHECKPOINT_NAME

# Generation:

accelerate launch -m metr.run_metr \
--project_name generate_$CHECKPOINT_NAME \
--run_name 3k_4k_generation --w_channel 3 --w_pattern ring \
--start 3000 --end 4000 \
--reference_model ViT-g-14 --reference_model_pretrain laion2b_s12b_b42k \
--with_tracking \
--save_locally \
--local_path $CHECKPOINT_NAME \
--decoder_state_dict_path finetune_ldm_decoder/$CHECKPOINT_NAME.pth

# Evaluation:

accelerate launch -m metr.metr_pp_eval_stable_sig \
--with_tracking \
--project_name eval_$CHECKPOINT_NAME \
--run_name vae_st_tr_imgs_no_tree \
--eval_imgs False --eval_bits True \
--img_dir $EVAL_PATH \
--output_dir logs_vae_st_tr_imgs_st_tr \
--msg_decoder_path dec_48b_whit.torchscript.pt \
--attack_mode few \
--key_str 111010110101000001010111010011010100010000100111
49 changes: 49 additions & 0 deletions scripts/stable_sig_different_distr/METR-N.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
TRAIN_DIR=generated_images/imgs_w
VAL_DIR=val_mock

CHECKPOINT_NAME=metr_n
EVAL_PATH="$CHECKPOINT_NAME/imgs_no_w"

# Fine-tuning:

accelerate launch -m metr.finetune_ldm_decoder --num_keys 1 \
--ldm_config v2-inference.yaml \
--ldm_ckpt v2-1_512-ema-pruned.ckpt \
--msg_decoder_path dec_48b_whit.torchscript.pt \
--train_dir $TRAIN_DIR \
--val_dir $VAL_DIR \
--with_tracking \
--project_name finetune_ldm_decoder \
--run_name test \
--output_dir finetune_ldm_decoder \
--batch_size 4 \
--steps 50 \
--num_val_imgs 1 \
--not_rand_key \
--key_str 111010110101000001010111010011010100010000100111 \
--checkpoint_name $CHECKPOINT_NAME

# Generation:

accelerate launch -m metr.run_metr \
--project_name generate_$CHECKPOINT_NAME \
--run_name 3k_4k_generation --w_channel 3 --w_pattern ring \
--start 3000 --end 4000 \
--reference_model ViT-g-14 --reference_model_pretrain laion2b_s12b_b42k \
--with_tracking \
--save_locally \
--local_path $CHECKPOINT_NAME \
--decoder_state_dict_path finetune_ldm_decoder/$CHECKPOINT_NAME.pth

# Evaluation:

accelerate launch -m metr.metr_pp_eval_stable_sig \
--with_tracking \
--project_name eval_$CHECKPOINT_NAME \
--run_name vae_st_tr_imgs_no_tree \
--eval_imgs False --eval_bits True \
--img_dir $EVAL_PATH \
--output_dir logs_vae_st_tr_imgs_st_tr \
--msg_decoder_path dec_48b_whit.torchscript.pt \
--attack_mode few \
--key_str 111010110101000001010111010011010100010000100111
51 changes: 51 additions & 0 deletions scripts/stable_sig_different_distr/N-METR.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
TRAIN_DIR=fid_outputs/coco/ground_truth
VAL_DIR=val_mock

CHECKPOINT_NAME=n_metr
EVAL_PATH="$CHECKPOINT_NAME/imgs_w"

# Fine-tuning:

accelerate launch -m metr.finetune_ldm_decoder --num_keys 1 \
--ldm_config v2-inference.yaml \
--ldm_ckpt v2-1_512-ema-pruned.ckpt \
--msg_decoder_path dec_48b_whit.torchscript.pt \
--train_dir $TRAIN_DIR \
--val_dir $VAL_DIR \
--with_tracking \
--project_name finetune_ldm_decoder \
--run_name test \
--output_dir finetune_ldm_decoder \
--batch_size 4 \
--steps 50 \
--num_val_imgs 1 \
--not_rand_key \
--key_str 111010110101000001010111010011010100010000100111 \
--checkpoint_name $CHECKPOINT_NAME

# Generation:

accelerate launch -m metr.run_metr \
--project_name generate_$CHECKPOINT_NAME \
--run_name 3k_4k_generation --w_channel 3 --w_pattern ring \
--start 3000 --end 4000 \
--reference_model ViT-g-14 --reference_model_pretrain laion2b_s12b_b42k \
--with_tracking \
--save_locally \
--local_path $CHECKPOINT_NAME \
--decoder_state_dict_path finetune_ldm_decoder/$CHECKPOINT_NAME.pth

# Evaluation:

EVAL_PATH="$CHECKPOINT_NAME/imgs_w"

accelerate launch -m metr.metr_pp_eval_stable_sig \
--with_tracking \
--project_name eval_$CHECKPOINT_NAME \
--run_name vae_st_tr_imgs_no_tree \
--eval_imgs False --eval_bits True \
--img_dir $EVAL_PATH \
--output_dir logs_vae_st_tr_imgs_st_tr \
--msg_decoder_path dec_48b_whit.torchscript.pt \
--attack_mode few \
--key_str 111010110101000001010111010011010100010000100111
48 changes: 48 additions & 0 deletions scripts/stable_sig_different_distr/N-N.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
TRAIN_DIR=fid_outputs/coco/ground_truth
VAL_DIR=val_mock

CHECKPOINT_NAME=n_n
EVAL_PATH="$CHECKPOINT_NAME/imgs_no_w"
# Fine-tuning:

accelerate launch -m metr.finetune_ldm_decoder --num_keys 1 \
--ldm_config v2-inference.yaml \
--ldm_ckpt v2-1_512-ema-pruned.ckpt \
--msg_decoder_path dec_48b_whit.torchscript.pt \
--train_dir $TRAIN_DIR \
--val_dir $VAL_DIR \
--with_tracking \
--project_name finetune_ldm_decoder \
--run_name test \
--output_dir finetune_ldm_decoder \
--batch_size 4 \
--steps 50 \
--num_val_imgs 1 \
--not_rand_key \
--key_str 111010110101000001010111010011010100010000100111 \
--checkpoint_name $CHECKPOINT_NAME

# Generation:

accelerate launch -m metr.run_metr \
--project_name generate_$CHECKPOINT_NAME \
--run_name 3k_4k_generation --w_channel 3 --w_pattern ring \
--start 3000 --end 4000 \
--reference_model ViT-g-14 --reference_model_pretrain laion2b_s12b_b42k \
--with_tracking \
--save_locally \
--local_path $CHECKPOINT_NAME \
--decoder_state_dict_path finetune_ldm_decoder/$CHECKPOINT_NAME.pth

# Evaluation:

accelerate launch -m metr.metr_pp_eval_stable_sig \
--with_tracking \
--project_name eval_$CHECKPOINT_NAME \
--run_name vae_st_tr_imgs_no_tree \
--eval_imgs False --eval_bits True \
--img_dir $EVAL_PATH \
--output_dir logs_vae_st_tr_imgs_st_tr \
--msg_decoder_path dec_48b_whit.torchscript.pt \
--attack_mode few \
--key_str 111010110101000001010111010011010100010000100111

0 comments on commit 07e27cd

Please sign in to comment.