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

dimension-specific vmin and vmax in render_array #42

Open
eringrant opened this issue Oct 13, 2024 · 0 comments
Open

dimension-specific vmin and vmax in render_array #42

eringrant opened this issue Oct 13, 2024 · 0 comments
Labels
feature-request New feature or request

Comments

@eringrant
Copy link

A common use case for me is visualizing an N-d array where one axis represents varying semantics (like loss vs. accuracy), but it is still meaningful to visualize the joint array because of shared coordinates. In those cases, I found that the global arguments for vmin and vmax are limiting because the scales of the different semantic dimension are distinct.

It would be great to be able to specify a dimension-specific value for vmin and vmax.
Adapting an example from the docs:

import numpy as np
import treescope

my_3d_array = np.einsum(
    'ijk,i->ijk',
    np.cos(np.arange(5*6*7).reshape((5,6,7)) * 0.1),
    np.array([1.0, 2.0, 3.0, 4.0, 5.0]),
)

As a possible interface, I could think of adapting this global variant:

treescope.render_array(my_3d_array, vmin=-5.0, vmax=5.0)

to a dimension-specific variant like:

treescope.render_array(
    my_3d_array,
    axis_vmin={
        0: (-1.0, -2.0, -3.0, -4.0, -5.0),
    },
    axis_vmax={
        0: (1.0, 2.0, 3.0, 4.0, 5.0),
    },
)

Is this in scope of render_array?

@danieldjohnson danieldjohnson added the feature-request New feature or request label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants