graphinvent/GraphGenerator.py
def _conn_nodes(conn : Tuple[torch.Tensor, ...], generation_round : int,
                        likelihoods_sampled : torch.Tensor) -> None:
            """
            Connects nodes in graphs which sampled the "connect" action.

            Args:
            ----
                conn (tuple)                       : Indices for "connect" actions
                                                     sampled for batch of graphs.
                generation_round (int)             : Indicates current generation
                                                     round.
                likelihoods_sampled (torch.Tensor) : NLL per action sampled for the
                                                     most recent set of actions.
            """
            # get the action indices
            conn = [idx.long() for idx in conn]
            batch, bond_to, bond_type, bond_from = conn

            # apply the connect actions
            self.edges[batch, bond_from, bond_to, bond_type] = 1
            self.edges[batch, bond_to, bond_from, bond_type] = 1

            # include the NLLs for the connect actions for this generation round
            self.likelihoods[batch, generation_round] = likelihoods_sampled[batch]

            Connects nodes in graphs which sampled the "connect" action.

            Args:
            ----
                conn (tuple)                       : Indices for "connect" actions
                                                     sampled for batch of graphs.
                generation_round (int)             : Indicates current generation
                                                     round.
                likelihoods_sampled (torch.Tensor) : NLL per action sampled for the
                                                     most recent set of actions.
            
Connects nodes in graphs which sampled the "connect" action.
Connects nodes in graphs which sampled the " connect " action .
def _conn_nodes(conn : Tuple[torch.Tensor, ...], generation_round : int,
                        likelihoods_sampled : torch.Tensor) -> None:
            conn = [idx.long() for idx in conn]
            batch, bond_to, bond_type, bond_from = conn
            self.edges[batch, bond_from, bond_to, bond_type] = 1
            self.edges[batch, bond_to, bond_from, bond_type] = 1
            self.likelihoods[batch, generation_round] = likelihoods_sampled[batch]
def _conn_nodes ( conn : Tuple [ torch . Tensor , ... ] , generation_round : int , likelihoods_sampled : torch . Tensor ) -> None : conn = [ idx . long ( ) for idx in conn ] batch , bond_to , bond_type , bond_from = conn self . edges [ batch , bond_from , bond_to , bond_type ] = 1 self . edges [ batch , bond_to , bond_from , bond_type ] = 1 self . likelihoods [ batch , generation_round ] = likelihoods_sampled [ batch ]
Connects nodes in graphs which sampled the "connect" action.
Connects nodes in graphs which sampled the " connect " action .
"""
            Connects nodes in graphs which sampled the "connect" action.

            Args:
            ----
                conn (tuple)                       : Indices for "connect" actions
                                                     sampled for batch of graphs.
                generation_round (int)             : Indicates current generation
                                                     round.
                likelihoods_sampled (torch.Tensor) : NLL per action sampled for the
                                                     most recent set of actions.
            """ # get the action indices # apply the connect actions # include the NLLs for the connect actions for this generation round
conn
Tuple[torch.Tensor, ...]
Indices for "connect" actions
sampled for batch of graphs.
Indices for " connect " actions sampled for batch of graphs .
generation_round
int
Indicates current generation
round.
Indicates current generation round .
likelihoods_sampled
torch.Tensor
NLL per action sampled for the
most recent set of actions.
NLL per action sampled for the most recent set of actions .