jasonkyuyim / se3_diffusion

Implementation for SE(3) diffusion model with application to protein backbone generation
https://arxiv.org/abs/2302.02277
MIT License
305 stars 50 forks source link

Small runtime improvement #13

Closed amorehead closed 1 year ago

amorehead commented 1 year ago

Hello again. To improve runtime efficiency (slightly), in this function, you should be able to instead set K via K = torch.arange(embed_size//2, device=indices.device). Then, you should be able to remove the two .to() calls in the remainder of this function since K (and its Tensor derivatives) will already be loaded onto the correct device.

https://github.com/jasonkyuyim/se3_diffusion/blob/420b1fe6d3da53ff17490e5b599df2acca5039e5/model/score_network.py#L25

jasonkyuyim commented 1 year ago

Thanks. Added here https://github.com/jasonkyuyim/se3_diffusion/commit/a739080859f0abd1ea216c6907b3028a7ed3c4b3