flowMC icon indicating copy to clipboard operation
flowMC copied to clipboard

integrate FlowMatching with MCMC

Open Jice-Zeng opened this issue 5 months ago • 3 comments

I am attempting to integrate a trained flow matching model with an MCMC algorithm, similar to how Normalizing Flows are combined with MALA. However, this combination is causing multiple issues, including data incompatibility errors. I can train the flow matching model successfully, and it works well on its own. The problem specifically occurs when I try to compile flow matching with MCMC. I wonder if you have some examples using flow matching with MCMC, as it would be very helpful. Thanks!

Jice-Zeng avatar Oct 27 '25 18:10 Jice-Zeng

Disclaimer: this code base is in a very low maintenance state given my current focus in life. I will update this in the README.md soon but just be aware that I am not actively doing anything or even frequently looking at the code.

Before I decided to put down flowMC along some other projects a couple of months, I think I have completed a simple flow matching model in flowMC here https://github.com/kazewong/flowMC/blob/main/src/flowMC/resource/model/flowmatching/base.py

I think it fits in how the codebase works pretty smoothly, but I also have to admit my memory is vague on this. Perhaps you can try integrating this into your case to see if it works. You can draw some inspiration from the tutorial notebooks on how to do so https://github.com/kazewong/flowMC/tree/main/docs/tutorials

kazewong avatar Oct 28 '25 13:10 kazewong

Hi @kazewong

Thank you for your reply and for your time and contribution to this package.

I’ve been experimenting with using the FlowMatching model within the MCMC pipeline. It seems to work in general—the posteriors are recovered—but I noticed that the global acceptance rate is quite low. I suspect the flow model may not be sufficiently trained. I’ve tried increasing the training time and the number of training samples, but the global acceptance rate remains poor, and there are no clear jumps between chains.

Do you have any suggestions on how I could improve the global acceptance rate?

I really appreciate your help and insights!

Jice-Zeng avatar Oct 28 '25 18:10 Jice-Zeng

Hi @Jice-Zeng,

Just like you I am also utilizing flowMC in one of my project; GWKokab.

Do you have any tutorial on how you are using Flow Matching from flowMC? If you can share here, it would be helpful.

Qazalbash avatar Oct 28 '25 19:10 Qazalbash