Skip to content

Visualize the model #211

Answered by stes
yuyiyi asked this question in Q&A
Jan 15, 2025 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hi @yuyiyi , yes this is possible, you need to follow sklearn-logic for this (i.e., you need to call the fit() function once, e.g. by setting the # of steps very low).

>>> import cebra
>>> import numpy as np

>>> X = np.random.randn(1000, 50)
>>> model = cebra.CEBRA(max_iterations=10)
>>> model.fit(X)
CEBRA(max_iterations=10)
>>> print(model)
CEBRA(max_iterations=10)
>>> print(model.model_)
Offset0Model(
  (net): Sequential(
    (0): Flatten(start_dim=1, end_dim=-1)
    (1): Linear(in_features=50, out_features=32, bias=True)
    (2): GELU(approximate='none')
    (3): Linear(in_features=32, out_features=32, bias=True)
    (4): GELU(approximate='none')
    (5): Linear(in_features=32, out_fe…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@yuyiyi
Comment options

@stes
Comment options

stes Jan 25, 2025
Maintainer

Answer selected by stes
@stes
Comment options

stes Feb 24, 2025
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants