flatironinstitute / cryoSBI

6 stars 0 forks source link

Automatically compute normalization for theta #55

Open Dingel321 opened 5 months ago

Dingel321 commented 5 months ago

Instead of manually computing the normalization, one could also just automatically compute and save it in the NPE object.

aevans1 commented 5 months ago

For this case, could one then use the output of the flow as approximating the joint between param and data instead of the posterior?

Dingel321 commented 5 months ago

Ah, here I mean the parameters in the training readme "THETA_SCALE" and "THETA_SHIFT". They are used to scale the theta, which is usually in units in the index, so from 0 to num_models to some number between -1 and 1. This helps with the convergence of the NN and might not be clear to a new user. Also, we can just get the number from the model file. So ni practice i choose them always THETA_SCALE = THETA_SHIFT = max_index / 2. In this case theta gets rescaled so that its always between -1 and 1. The formula for rescaling is theta_rescaled = theta / THETA_SCALE - THETA_SHIFT.

PS: But it is in interesting question!! Since normally we don't have the normalization