Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How could I perform semantic experiment in e2e dataset? #46

Open
WangCan1178 opened this issue Nov 9, 2022 · 2 comments
Open

How could I perform semantic experiment in e2e dataset? #46

WangCan1178 opened this issue Nov 9, 2022 · 2 comments

Comments

@WangCan1178
Copy link

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?

@XiangLi1999
Copy link
Owner

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!

@WangCan1178
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants