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 ... pattern to copybutton config #41

Merged
merged 1 commit into from
Jul 12, 2023
Merged

Add ... pattern to copybutton config #41

merged 1 commit into from
Jul 12, 2023

Conversation

stes
Copy link
Member

@stes stes commented Jul 12, 2023

Before, lines with ... were not copied by using the copy button. This PR fixes that behavior by adapting the config for the sphinx copybutton package.

Example

image

copied code:

import cebra.distributions.multisession as cebra_distributions_multisession
import cebra.integrations.sklearn.dataset as cebra_sklearn_dataset
import cebra.data
import torch
from torch import nn
# Multisession training: one model per dataset (different input dimensions)
session1 = torch.rand(100, 30)
session2 = torch.rand(100, 50)
index1 = torch.rand(100)
index2 = torch.rand(100)
num_features = 8
dataset = cebra.data.DatasetCollection(
              cebra_sklearn_dataset.SklearnDataset(session1, (index1, )),
              cebra_sklearn_dataset.SklearnDataset(session2, (index2, )))
model = nn.ModuleList([
               cebra.models.init(
                   name="offset1-model",
                   num_neurons=dataset.input_dimension,
                   num_units=32,
                   num_output=num_features,
               ) for dataset in dataset.iter_sessions()]).to("cpu")
sampler = cebra_distributions_multisession.MultisessionSampler(dataset, time_offset=10)

Fix https://github.com/AdaptiveMotorControlLab/CEBRA-dev/issues/630
Fix https://github.com/AdaptiveMotorControlLab/CEBRA-dev/pull/652

@cla-bot cla-bot bot added the CLA signed label Jul 12, 2023
@stes stes changed the title Add ... pattern to copybutton config Add ... pattern to copybutton config Jul 12, 2023
@stes stes self-assigned this Jul 12, 2023
@stes stes added bug Something isn't working documentation Improvements or additions to documentation labels Jul 12, 2023
@stes
Copy link
Member Author

stes commented Jul 12, 2023

Approved internally.

@stes stes merged commit e011694 into main Jul 12, 2023
@stes stes deleted the stes/fix-copybutton branch July 12, 2023 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLA signed documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant