XiangLi1999 / Diffusion-LM

Diffusion-LM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How could I perform semantic experiment in e2e dataset?

WangCan1178 opened this issue · comments

Hello, thank you for the great work!
How could I perform semantic experiment (use a attribute such as 'food: Japanese' to control the model) in e2e dataset? I don't know which command should be execute .
Is there an example please?

In addition, what do I do if I want to use more than one attribute, such as "name", "type", etc. given in the e2e dataset?

Hi,

Thanks for the question.
You need to first train a classifier using this command:
python train_run.py --experiment e2e-back --app "--init_emb diff_e2e-tgt_pad_rand16_transformer_lr0.0001_0.0_2000_sqrt_Lsimple_h128_s2_d0.1_sd102_xstart_e2e --n_embd 16 --learned_emb yes " --notes "full_multi_sqrt_16" --epoch 6 --bsz 10

[you might want to modify the --init_emb command, which is the path to your diffusion model, Or you can download it here: https://drive.google.com/drive/folders/110CA22rwu_3EcllPYGhql0TnYeOBY77d and set init_emb to this path. ]

Then to execute the controllable generation:

python scripts/infill.py --model_path /u/scr/nlp/xlisali/predictability/diffusion_models_ablations/diff_e2e-tgt_pad_rand16_transformer_lr0.0001_0.0_2000_sqrt_Lsimple_h128_s2_d0.1_sd102_xstart_e2e/ema_0.9999_200000.pt --eval_task_ 'control_attribute' --use_ddim True --notes "tree_full_adagrad" --eta 1. --verbose pipe --lr_coef 0.0005

Again, you might want to change the model_path to the diffusion path.

Hope this helps!

Hi,

Thanks for the question. You need to first train a classifier using this command: python train_run.py --experiment e2e-back --app "--init_emb diff_e2e-tgt_pad_rand16_transformer_lr0.0001_0.0_2000_sqrt_Lsimple_h128_s2_d0.1_sd102_xstart_e2e --n_embd 16 --learned_emb yes " --notes "full_multi_sqrt_16" --epoch 6 --bsz 10

[you might want to modify the --init_emb command, which is the path to your diffusion model, Or you can download it here: https://drive.google.com/drive/folders/110CA22rwu_3EcllPYGhql0TnYeOBY77d and set init_emb to this path. ]

Then to execute the controllable generation:

python scripts/infill.py --model_path /u/scr/nlp/xlisali/predictability/diffusion_models_ablations/diff_e2e-tgt_pad_rand16_transformer_lr0.0001_0.0_2000_sqrt_Lsimple_h128_s2_d0.1_sd102_xstart_e2e/ema_0.9999_200000.pt --eval_task_ 'control_attribute' --use_ddim True --notes "tree_full_adagrad" --eta 1. --verbose pipe --lr_coef 0.0005

Again, you might want to change the model_path to the diffusion path.

Hope this helps!

Helps a lot !

But I still need some help.😭

I don't know how to train my own diffusion model for this task, is it the same command as
"python scripts/run_train.py --diff_steps 2000 --model_arch transformer --lr 0.0001 --lr_anneal_steps 200000 --seed 102 --noise_schedule sqrt --in_channel 16 --modality e2e-tgt --submit no --padding_mode block --app "--predict_xstart True --training_mode e2e --vocab_size 821 --e2e_train ../datasets/e2e_data " --notes xstart_e2e"
in README?

Specifically, do some configs need to be changed, such as training_mode or the modality, if so, what should they be changed?

Thanks again!