ITADN

dimension-specific `vmin` and `vmax` in `render_array`

#42Openeringrant 创建于 2024-10-13
E
eringrantcommented
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: ```python 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: ```python treescope.render_array(my_3d_array, vmin=-5.0, vmax=5.0) ``` to a dimension-specific variant like: ```python 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`?
0 条评论