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

Plotly integration #84

Conversation

nastya236
Copy link
Contributor

@nastya236 nastya236 commented Oct 3, 2023

Also see #82 which was merged into main.

requires matplotlib ~3.6.2 ie, less than 3.7.1

Example:

import cebra
import numpy as np
from plotly.subplots import make_subplots
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()
Screenshot 2023-10-03 at 09 42 01

@stes
Copy link
Member

stes commented Oct 3, 2023

merging this over to the other PR, thanks @nastya236 !

@stes stes merged commit 76ba40b into AdaptiveMotorControlLab:nastya/interactive_plots-rebased Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants