olorenchemengine.external.GINNetwork package#

Submodules#

olorenchemengine.external.GINNetwork.main module#

Wrapping the GIN network family based on:

GINEPLUS GitHub repository Graph convolutions that can finally model local structure

class olorenchemengine.external.GINNetwork.main.GINModel(task_type='classification', hidden: str = 100, lr: float = 0.001, layers=3, dropout=0.5, virtual_node=False, conv_radius=3, conv_type='gin+', optim='adam', **kwargs)#

Bases: BaseLightningModule

GINModel class from GINEPLUS GitHub repository <https://github.com/RBrossard/GINEPLUS>.

Parameters:
  • task_type (str) – Type of task to perform. Options are ‘regression’ or ‘classification’. This task_type will automatically be set by BaseTorchGeometricModel and usually does not need to be set manually.

  • hidden (int) – Number of nodes per hidden layer.

  • lr (float) – Learning rate.

  • layers (int) – Number of hidden layers.

  • dropout (float) – Dropout rate.

  • virtual_node (bool) – Whether to use virtual node.

  • conv_type (str) – Type of convolution to use. Options are ‘gcn’, ‘gin’, ‘gin+’, ‘naivegin+’.

  • conv_radius (int) – Radius of convolution.

  • optim (str) – Optimizer to use. Options are ‘adam’.

olorenchemengine.external.GINNetwork.operations module#

olorenchemengine.external.GINNetwork.operations.make_multihop_edges(data, k)#

Adds edges corresponding to distances up to k to a data object. :param data: torch_geometric.data object, in coo format (ie an edge (i, j) with label v is stored with an arbitrary index u as:

edge_index[0, u] = i, edge_index[1, u]=j, edge_attr[u]=v)

Returns:

a new data object with new fields, multihop_edge_index and distance.

distance[u] contains values from 1 to k corresponding to the distance between multihop_edge_index[0, u] and multihop_edge_index[1, u]

olorenchemengine.external.GINNetwork.operations.new(data)#

Module contents#