lfads / lfads-run-manager

Matlab interface for Latent Factor Analysis via Dynamical Systems (LFADS)
https://lfads.github.io/lfads-run-manager
Apache License 2.0
50 stars 29 forks source link

Reconstructed factors are distinct with real latent variables in lorenz example #29

Closed NebulaWang closed 4 years ago

NebulaWang commented 4 years ago

Hi, I have run the lorenz_example successfully used same hyper-parameters as nature method papers, but i find that reconstructed factors are distinct with real ones(lorenz-system). I want to know the reason and to fix the model to reconstruct real system well. Recons

djoshea commented 4 years ago

Hi Xingyun, great to hear you've gotten the Lorenz example up and running. In cases like this where you have a synthetic ground truth, the factors inferred by LFADS may or may not match the factors in the data generating process. From your right hand plots, the reconstructed firing rates match the true firing rates fairly accurately, which is what LFADS is ultimately optimizing for. There may be a large space of nonlinear dynamical systems that can reproduce these dynamics on short timespans, and LFADS has identified one of them. (There's a bit of nuance here in that LFADS is a variational autoencoder, so its really optimizing for a distribution over firing rates which you are plotting the posterior mean of) It may be that in some cases you can recover the ground truth system more accurately, but in the neuroscience context where there is no ground truth to compare it to, the goal is to infer a set of latent factors that obey lawful dynamics while reproducing the observed neural dynamics we record.

As far as this specific example, any discrepancies with the chaotic RNN in the published paper may result from differences in the exact data generating process. The paper used the data generated by run_generate_synth_data.sh instead of the Matlab code provided here for convenience. https://github.com/lfads/models/tree/master/research/lfads

NebulaWang commented 4 years ago

Wonderful explanation! Thanks a lot! Your method really help me a lot to understand the latent dynamics relevant to bran function. Wish you and your team can achieve novel progresses in this area. Best wishes.