Skip to content
Discussion options

You must be logged in to vote

Hi Ali, this happens during composition of the user-specified density estimator ("mdn", "maf" etc), the z-scoring transforms, and the potential user-specified embedding net. The composition of the these nets always happens on the cpu, therefore the hardcoded "cpu".

Thus, if you are passing an embedding net to posterior_nn then this net should be on the CPU, even if you later want to train on GPU.

This is how it could look like:

net_builder = posterior_nn(
    model="maf", 
    z_score_x="structured", 
    embedding_net=your_embedding_on_cpu
)

trainer = NPE(prior=prior, density_estimator=net_builder, device="cuda")

passing device="cuda" (or your local device name), is all you need to trai…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ali-akhavan89
Comment options

Answer selected by ali-akhavan89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants