cyye001 / Con-CDVAE

12 stars 2 forks source link

Some of the problems I'm having when I want to add new property conditions? #4

Open Zhoushun2021 opened 3 weeks ago

Zhoushun2021 commented 3 weeks ago
  Thank you very much for your contribution! Here are my training commands for step 2 (I used conz_1.yaml):

python scripts/condition_diff_z.py --model_path /home/ps/yhxproject/Con-CDVAE-main1/output/hydra/singlerun/2024-08-21/test --model file model_test.pth --fullfea 1 --newcond /home/ps/project/Con-CDVAE-main1/conf/conz_1.yaml --newdata mptest4conz.

It will involve new features like ‘density’ etc. May I ask how his loss rate is calculated? How is it reflected in the code? Because I noticed that the first step of training requires relevant conditional models to encode as well as conditional predictions such as conditionmodel, xxx.yaml under the conditionpre file. as well as there is PreCondition.py to calculate the loss. So does conz_1.yaml also need the corresponding conditionpre.yaml?

image

cyye001 commented 3 weeks ago

In the first step of training, we want to make the crystal latent space under the VAE framework have a special structure, that the crystals with more similar physical properties are closer together in the latent variable space, so we need to add a loss function for predicting properties to the general VAE loss function.

In the second training step, we have only one task, using physical properties to generate crystal latent variables, so there is no additional loss function.

Zhoushun2021 commented 2 weeks ago

I don't understand what is used to represent and calculate the loss of properties? Is it involved in the training?Because I noticed in model.py that it was commented out. And the function ‘predict_property’ isn't being called @cyye001 image image

cyye001 commented 2 weeks ago

I didn't use the ‘predict_property’, which was used by the original CDVAE. You can chack the predict loss in the line 179-182 and line 268-273 of the model.py.

Zhoushun2021 commented 2 weeks ago

Following your tips has solved my confusion, thank you very much for your answer! @cyye001