nip.graph_isomorphism.rollout_samples.GraphIsomorphismRolloutSamples#

class nip.graph_isomorphism.rollout_samples.GraphIsomorphismRolloutSamples(run_id: str, iteration: int, wandb_entity: str | None = None, wandb_project: str | None = None, silence_wandb: bool = True)[source]#

A message exchange in the graph isomorphism task.

Methods Summary

__contains__(item)

__enter__()

__exit__(exc_type, exc_value, traceback)

__getitem__(key)

__init__(run_id, iteration[, wandb_entity, ...])

__iter__()

__len__()

__repr__()

Return repr(self).

__str__()

Return str(self).

finish()

Finish the W&B run.

visualise([graph_layout_function, ...])

Visualize the rollout as a plotly graph.

Methods

__contains__(item)[source]#
__enter__()[source]#
__exit__(exc_type, exc_value, traceback)[source]#
__getitem__(key)[source]#
__init__(run_id: str, iteration: int, wandb_entity: str | None = None, wandb_project: str | None = None, silence_wandb: bool = True)[source]#
__iter__()[source]#
__len__()[source]#
__repr__()[source]#

Return repr(self).

__str__()[source]#

Return str(self).

finish()[source]#

Finish the W&B run.

visualise(graph_layout_function: callable | None = None, graph_layout_seed: int | None = None, colour_sequence: str = 'Dark24', node_text_colour: str = 'white')[source]#

Visualize the rollout as a plotly graph.

Parameters:
  • graph_layout_function (callable, default=None) – A function which takes a networkx graph and returns a dictionary of node positions. Best to use a function from networkx.layout, possibly partially applied with some arguments. If None, uses networkx.spring_layout with k=4/sqrt(n), where n is the number of nodes in the graph.

  • graph_layout_seed (int, default=None) – The seed to use for the graph layout function. If None, the random number generator is the RandomState instance used by numpy.random.

  • colour_sequence (str, default="Dark24") – The name of the colour sequence to use to colour the nodes. Must be one of the colour sequences from plotly.express.colors.qualitative.

  • node_text_colour (str, default="white") – The colour of the node labels.