AdaptiveMotorControlLab / CEBRA

Learnable latent embeddings for joint behavioral and neural analysis - Official implementation of CEBRA
https://cebra.ai
Other
907 stars 76 forks source link

Generating synthetic data and importing pyvae for colab notebook #18

Closed carlacodes closed 1 year ago

carlacodes commented 1 year ago

Hi, I'm trying to replicate the synthetic neural benchmarking notebook (https://cebra.ai/docs/demo_notebooks/Demo_synthetic_exp.html) for our group's lab meeting presentation/discussion using Google CoLab. What functions should I call to replicate the synthetic data generated in line 1 of the Let's Load the Data cell? Currently, I'm getting an attribute error suggesting I'm missing some critical step that generates the synthetic data:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
[<ipython-input-13-812dd7e79322>](https://localhost:8080/#) in <cell line: 1>()
----> 1 data = jl.load(get_datapath('synthetic/continuous_label_poisson.jl'))
      2 plt.scatter(data['z'][:, 0], data['z'][:, 1], c=data['u'], s=1, cmap='cool')
      3 plt.axis('off')

[/usr/local/lib/python3.10/dist-packages/joblib/numpy_pickle.py](https://localhost:8080/#) in load(filename, mmap_mode)
    648             obj = _unpickle(fobj)
    649     else:
--> 650         with open(filename, 'rb') as f:
    651             with _read_fileobject(f, filename, mmap_mode) as fobj:
    652                 if isinstance(fobj, str):

FileNotFoundError: [Errno 2] No such file or directory: 'data/synthetic/continuous_label_poisson.jl'

I'm also wondering how pivae is imported in this notebook, as the structure online on the repository (https://github.com/lukasadam/piVAE) seems to be different than the import structure in the notebook. Is this notebook just importing the pivae.py file (https://github.com/lukasadam/piVAE/blob/master/pivae.py)?

Thanks in advance.

MMathisLab commented 1 year ago

Hi @carlacodes - thanks for your interest. Did you download the synthetic data from figshare and put in your Google drive?

Also the piVAE repo you link is not the piVAE we use in our paper ;) please see paper for links and the demo notebook for conv-pi-VAE

carlacodes commented 1 year ago

Thanks, I totally missed that; closing this issue now. OK, will check the paper for the pivae repository link.

stes commented 1 year ago

For future reference, the figshare link is https://figshare.com/s/60adb075234c2cc51fa3 and currently advertised at the top of https://cebra.ai/docs/demos.html.

Thanks for flagging, @carlacodes !

MMathisLab commented 1 year ago

also for future // @carlacodes:

If you want to easily download the FigShare data in colab, you can use this code sniplet and put into a top code cell :

#for google colab only, run this cell to download and extract data:
!wget --content-disposition https://figshare.com/ndownloader/files/36869049?private_link=60adb075234c2cc51fa3
!mkdir data
!tar -xvf "/content/data.tgz" -C "/content/data"