towhee.models.visualization.transformer_visualizationΒΆ
Functions
Generate attention visualization of the model. |
|
Show image heatmap for transformer model. :param model: Transformer model. :type model: nn.Module :param pil_img: Pil Image. :type pil_img: Image :param method: full, rollout or transformer_attribution. Algorithm for attention vis, default is transformer_attribution :type method: str :param transform: Pytorch transforms or function, can be None by default. :type transform: Any :param device: model device. :type device: str. |
Classes
Layer-wise relevance propagation. |