Ask HN:你们如何可视化张量?
1 分•作者: HardikVala•8 个月前
我经常需要打印原始张量(手动打印或将其转储到标准输出),尤其是在阅读 PyTorch / Jax 代码时,以便理解各种变换,例如,对于类似这样的代码:
`x = torch.randn(32, 3, 224, 224).unfold(2, 16, 16).unfold(3, 16, 16).reshape(32, 3, 196, 256).transpose(1, 2).reshape(32, 196, 768).view(32, 196, 12, 64).transpose(1, 2)`
大家是如何可视化张量,从而快速理解复杂神经网络中的数据流的呢?
查看原文
I constantly find myself having to print raw tensors (either by hand or dumping them to stdout), especially when reading pytorch / jax code, to understand the transformations, e.g. for something like,<p>`x = torch.randn(32, 3, 224, 224).unfold(2, 16, 16).unfold(3, 16, 16).reshape(32, 3, 196, 256).transpose(1, 2).reshape(32, 196, 768).view(32, 196, 12, 64).transpose(1, 2)`<p>How do folks visualize tensors to quickly understand data flow in complex NN's?