Open francescotaioli opened 1 month ago
Hi @francescotaioli, and thank you for the issue!
I really like the idea - I'm unhappy with the limitations that come with the current labeling in general. For example, tensors have labels by default, while images do not.
I was considering changing this so that by default nothing has labels and you can change the default by setting tensorhue.set_printoptions(label=True)
.
Another question that you correctly raise is that currently you can't customize your label. For example, in tensors -inf and +inf have their own special color. It could be nice to include that information in a legend next to the tensor. You could also think about adding the text you mentioned not as label (below the tensor) but as title (above the tensor). There is also room right of the tensor.
Do you mind sharing your thoughts on this? What would you prefer?
I was considering changing this so that by default nothing has labels and you can change the default by setting
This sounds like a great idea, as long as the label argument remains part of the function definition (thus you could turn on for that particular function call)
legend next to the tensor.
It would be fantastic to include a legend for every tensor displayed. For instance, even for a boolean tensor, a legend could clarify which color corresponds to True and which to False.
You could also think about adding the text you mentioned not as label (below the tensor) but as title (above the tensor)
I was thinking the same thing—I may have used the wrong terminology earlier. The goal is to have a title (passed as an argument) that visually explains the tensor being displayed. You might also allow users to choose a specific color for this title—perhaps using a library like colorama for that purpose.
I'm a little conflicted when it comes to a title above the tensor - this is essentially just a regular print statement that you could prepend to your .viz() call, like here:
this is essentially just a regular print statement that you could prepend to your .viz() call
yes, but I think that an argument to viz would come in handy. In your example,
torch.rand(40,40).viz("Random tensor")
This could be displayed above the image, or in the legend.
First of all, great project!
Describe the solution you'd like Currently, when multiple viz() calls are made in sequence, it becomes challenging to differentiate between them. To enhance clarity and usability, I propose allowing an additional parameter in the
viz()
function, such as a label, which can be used to annotate the visualizations.Additional context