NVIDIA-Merlin / Transformers4Rec

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation and works with PyTorch.
https://nvidia-merlin.github.io/Transformers4Rec/main
Apache License 2.0
1.07k stars 142 forks source link

[QST] Visualize the NN architecture #732

Closed vivpra89 closed 1 year ago

vivpra89 commented 1 year ago

❓ Questions & Help

Details

Is there an example on how to visualize the NN architecture after we get "model = tr.Model(head)". Also is it possible to extract it as a pytorch or TF model to use utils to plot.

vivpra89 commented 1 year ago

from torchview import draw_graph

model_graph = draw_graph(model_si,input_data=batch) model_graph.resize_graph(scale=50)

displayHTML(model_graph.visual_graph.pipe(format="svg").decode("utf-8")).to_html()

vivpra89 commented 1 year ago
image