Visualization¶
For educational purposes, the following module can be used to visualize dense SPNs.
-
libspn_keras.visualize.
visualize_dense_spn
(dense_spn, show_legend=False, show_padding=True, transparent=False, node_size=30)¶ Visualize dense SPN.
The dense SPN must consist of
DenseSum
,DenseProduct
,RootSum
and leaf layers.- Parameters
dense_spn (
Model
) – An SPN of typetensorflow.keras.Sequential
show_legend (
bool
) – Whether to show legend of scopes and layers on the rightshow_padding (
bool
) – Whether to show padded nodestransparent (
bool
) – IfTrue
, the background is transparent.node_size (
int
) – Size of the nodes drawn in the graph. Adjust to avoid clutter.
- Return type
Figure
- Returns
A
plotly.graph_objects.Figure
instance. Use.show()
to render the visualization.