Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interactive plots using plotly #82

Merged
merged 7 commits into from
Oct 3, 2023
Merged

Conversation

stes
Copy link
Member

@stes stes commented Oct 2, 2023

Adds plotly integration for better interactive plots in notebooks/demos.

Implemented by @nastya236

Usage example (e.g. in a COLAB notebook):

import cebra
import numpy as np
import cebra.integrations.plotly

data = cebra.datasets.init("rat-hippocampus-single-achilles")

X = np.random.uniform(0, 1, (100, 50))
y = np.random.uniform(0, 10, (100, 5))
cebra_model = cebra.CEBRA(max_iterations=3000, batch_size = 512, verbose = True)
cebra_model.fit(data.neural)

embedding = cebra_model.transform(data.neural)
time = np.arange(len(data))

fig = cebra.integrations.plotly.plot_embedding_interactive(embedding, embedding_labels=data.index[:,0])
fig.show()

Expected output

image


Fix https://github.com/AdaptiveMotorControlLab/CEBRA-dev/pull/747
Fix https://github.com/AdaptiveMotorControlLab/CEBRA-dev/pull/733

- Added interactive plots

- Add plotly integration

- Fix during testing, add header

- Add plotly to integrations

- Delete plotly import from matplotlib

- Add plotly to optdepends

- Add tests and update Makefile

- Checking whether pass test with required plotly

- Final check

- Delete redundent code

- Delete plotly from essential dependencies

- Final changes and test to interactive plot

- Fix docs

- apply pre-commit

- Adapt docstring
@stes stes added the enhancement New feature or request label Oct 2, 2023
@stes stes requested a review from MMathisLab October 3, 2023 11:43
@stes stes merged commit 9576a5a into main Oct 3, 2023
9 checks passed
@stes stes deleted the nastya/interactive_plots-rebased branch October 3, 2023 16:25
@stes stes mentioned this pull request Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants