tfds.visualization.GraphVisualizer

Visualizer for graph prediction datasets.

Inherits From: Visualizer

Methods

match

View source

Checks whether this dataset can be visualized with this visualizer.

See base class for more information. Args: ds_info: Metadata for the dataset.

Returns
boolean value indicating whether the current visualizer can be used.

show

View source

Display the dataset.

Args
ds tf.data.Dataset. The tf.data.Dataset object to visualize. Examples should not be batched. Examples will be consumed in order until (rows * cols) are read or the dataset is consumed.
ds_info tfds.core.DatasetInfo object of the dataset to visualize.
node_label_fn A callable that maps individual graph examples to a dictionary of node labels, rendered within the nodes.
node_color_fn A callable that maps individual graph examples to a dictionary of node colors.
edge_color_fn A callable that maps individual graph examples to a dictionary of edge colors.
rows int, number of rows of the display grid.
cols int, number of columns of the display grid.
plot_scale float, controls the plot size of the images. Keep this value around 5 to get a good plot. High and low values may cause the labels to get overlapped.
**kwargs Additional arguments passed to networkx.draw_networkx().

Returns
fig The pyplot figure.