Skip to content

Commit 7aaa7db

Browse files
committed
update setup.py
1 parent f508b0b commit 7aaa7db

File tree

2 files changed

+30
-62
lines changed

2 files changed

+30
-62
lines changed

libauc/models/gnn.py

Lines changed: 25 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
)
3030

3131

32-
__all__ = ['GCN', 'DeeperGCN', 'GIN', 'GINE', 'GAT', 'MPNN', 'GraphSAGE', 'PNA']
32+
__all__ = ['GCN', 'DeeperGCN', 'GIN', 'GINE', 'GAT', 'MPNN', 'GraphSAGE', 'PNA', 'AtomEncoder', 'BondEncoder']
3333

3434
pooling_options = {"sum":global_add_pool,
3535
"mean":global_mean_pool,
@@ -45,11 +45,8 @@ class GIN(BasicGNN):
4545
num_tasks (int): Number of tasks for multi-label classification.
4646
emb_dim (int): Size of embedding for each atom and/or bond and graph.
4747
num_layers (int): Number of message passing layers.
48-
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided,
49-
the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
50-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
51-
(:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`,
52-
:obj:`"set2set"`). (default: :obj:`"mean"`)
48+
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided, the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
49+
graph_pooling (str): Pooling function to generate whole-graph embeddings. (:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`, :obj:`"set2set"`). (default: :obj:`"mean"`)
5350
dropout (float, optional): Dropout probability. (default: :obj:`0.5`)
5451
act (str or Callable, optional): The non-linear activation function to
5552
use. (default: :obj:`"relu"`)
@@ -153,14 +150,9 @@ class GINE(BasicGNN):
153150
num_tasks (int): Number of tasks for multi-label classification.
154151
emb_dim (int): Size of embedding for each atom(node) and/or bond(edge) and graph.
155152
num_layers (int): Number of message passing layers.
156-
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided,
157-
the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
158-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
159-
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided,
160-
the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
161-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
162-
(:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`,
163-
:obj:`"set2set"`). (default: :obj:`"mean"`)
153+
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided, the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
154+
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided, the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
155+
graph_pooling (str): Pooling function to generate whole-graph embeddings. (:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`, :obj:`"set2set"`). (default: :obj:`"mean"`)
164156
dropout (float, optional): Dropout probability. (default: :obj:`0.5`)
165157
act (str or Callable, optional): The non-linear activation function to
166158
use. (default: :obj:`"relu"`)
@@ -268,11 +260,8 @@ class GCN(BasicGNN):
268260
num_tasks (int): Number of tasks for multi-label classification.
269261
emb_dim (int): Size of embedding for each atom and/or bond and graph.
270262
num_layers (int): Number of message passing layers.
271-
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided,
272-
the `atom_features_dims` will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
273-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
274-
(:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`,
275-
:obj:`"set2set"`). (default: :obj:`"mean"`)
263+
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided, the `atom_features_dims` will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
264+
graph_pooling (str): Pooling function to generate whole-graph embeddings. (:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`, :obj:`"set2set"`). (default: :obj:`"mean"`)
276265
dropout (float, optional): Dropout probability. (default: :obj:`0.5`)
277266
act (str or Callable, optional): The non-linear activation function to
278267
use. (default: :obj:`"relu"`)
@@ -375,14 +364,9 @@ class DeeperGCN(torch.nn.Module):
375364
num_tasks (int): Number of tasks for multi-label classification.
376365
emb_dim (int): Size of embedding for each atom(node) and/or bond(edge) and graph.
377366
num_layers (int): Number of message passing layers.
378-
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided,
379-
the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
380-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
381-
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided,
382-
the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
383-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
384-
(:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`,
385-
:obj:`"set2set"`). (default: :obj:`"mean"`)
367+
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided, the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
368+
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided, the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
369+
graph_pooling (str): Pooling function to generate whole-graph embeddings. (:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`, :obj:`"set2set"`). (default: :obj:`"mean"`)
386370
dropout (float, optional): Dropout probability. (default: :obj:`0.`)
387371
aggr (str or Aggregation, optional): The aggregation scheme to use.
388372
Any aggregation of :obj:`torch_geometric.nn.aggr` can be used,
@@ -497,17 +481,10 @@ class GAT(BasicGNN):
497481
num_tasks (int): Number of tasks for multi-label classification.
498482
emb_dim (int): Size of embedding for each atom(node) and/or bond(edge) and graph.
499483
num_layers (int): Number of message passing layers.
500-
v2 (bool, optional): If set to :obj:`True`, will make use of
501-
:class:`~torch_geometric.nn.conv.GATv2Conv` rather than
502-
:class:`~torch_geometric.nn.conv.GATConv`. (default: :obj:`False`)
503-
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided,
504-
the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
505-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
506-
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided,
507-
the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
508-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
509-
(:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`,
510-
:obj:`"set2set"`). (default: :obj:`"mean"`)
484+
v2 (bool, optional): If set to :obj:`True`, will make use of: class:`~torch_geometric.nn.conv.GATv2Conv` rather than :class:`~torch_geometric.nn.conv.GATConv`. (default: :obj:`False`)
485+
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided, the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
486+
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided, the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
487+
graph_pooling (str): Pooling function to generate whole-graph embeddings. (:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`, :obj:`"set2set"`). (default: :obj:`"mean"`)
511488
dropout (float, optional): Dropout probability. (default: :obj:`0.`)
512489
act (str or Callable, optional): The non-linear activation function to
513490
use. (default: :obj:`"relu"`)
@@ -631,14 +608,9 @@ class MPNN(BasicGNN):
631608
num_tasks (int): Number of tasks for multi-label classification.
632609
emb_dim (int): Size of embedding for each atom(node) and/or bond(edge) and graph.
633610
num_layers (int): Number of message passing layers.
634-
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided,
635-
the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
636-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
637-
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided,
638-
the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
639-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
640-
(:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`,
641-
:obj:`"set2set"`). (default: :obj:`"mean"`)
611+
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided, the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
612+
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided, the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
613+
graph_pooling (str): Pooling function to generate whole-graph embeddings. (:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`, :obj:`"set2set"`). (default: :obj:`"mean"`)
642614
dropout (float, optional): Dropout probability. (default: :obj:`0.2`)
643615
act (str or Callable, optional): The non-linear activation function to
644616
use. (default: :obj:`"relu"`)
@@ -745,11 +717,8 @@ class GraphSAGE(BasicGNN):
745717
num_tasks (int): Number of tasks for multi-label classification.
746718
emb_dim (int): Size of embedding for each atom and/or bond and graph.
747719
num_layers (int): Number of message passing layers.
748-
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided,
749-
the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
750-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
751-
(:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`,
752-
:obj:`"set2set"`). (default: :obj:`"mean"`)
720+
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided, the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
721+
graph_pooling (str): Pooling function to generate whole-graph embeddings. (:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`, :obj:`"set2set"`). (default: :obj:`"mean"`)
753722
dropout (float, optional): Dropout probability. (default: :obj:`0.2`)
754723
act (str or Callable, optional): The non-linear activation function to
755724
use. (default: :obj:`"relu"`)
@@ -844,14 +813,9 @@ class PNA(BasicGNN):
844813
num_tasks (int): Number of tasks for multi-label classification.
845814
emb_dim (int): Size of embedding for each atom(node) and/or bond(edge) and graph.
846815
num_layers (int): Number of message passing layers.
847-
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided,
848-
the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
849-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
850-
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided,
851-
the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>_`.
852-
graph_pooling (str): Pooling function to generate whole-graph embeddings.
853-
(:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`,
854-
:obj:`"set2set"`). (default: :obj:`"mean"`)
816+
atom_features_dims:(list or None, optional): Size of each category feature for atoms(nodes). if a list is not provided, the atom_features_dims will be filled by funtion `get_atom_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
817+
bond_features_dims:(list or None, optional): Size of each category feature for bonds(edges). if a list is not provided, the bond_features_dims will be filled by funtion `get_bond_feature_dims() <https://github.com/snap-stanford/ogb/blob/master/ogb/utils/features.py>`_.
818+
graph_pooling (str): Pooling function to generate whole-graph embeddings. (:obj:`"mean"`, :obj:`"sum"`, :obj:`"max"`, :obj:`"attention"`, :obj:`"set2set"`). (default: :obj:`"mean"`)
855819
dropout (float, optional): Dropout probability. (default: :obj:`0.2`)
856820
act (str or Callable, optional): The non-linear activation function to
857821
use. (default: :obj:`"relu"`)
@@ -947,6 +911,7 @@ def forward(self, x, edge_index, edge_attr, batch):
947911

948912

949913
class AtomEncoder(torch.nn.Module):
914+
r"""Convert discrete atom(node) features to embeddings"""
950915
def __init__(self, emb_dim, atom_features_dims):
951916
super(AtomEncoder, self).__init__()
952917
self.atom_embedding_list = torch.nn.ModuleList()
@@ -970,6 +935,7 @@ def forward(self, x):
970935

971936

972937
class BondEncoder(torch.nn.Module):
938+
r"""Convert discrete bond(edge) features to embeddings"""
973939
def __init__(self, emb_dim, bond_features_dims):
974940
super(BondEncoder, self).__init__()
975941

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="libauc",
8-
version="1.3.0",
8+
version="1.3.1",
99
author="Zhuoning Yuan, Tianbao Yang",
1010
description="LibAUC: A Deep Learning Library for X-Risk Optimization",
1111
long_description=long_description,
@@ -17,7 +17,7 @@
1717
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
1818
"Operating System :: OS Independent",
1919
],
20-
python_requires=">=3.6",
20+
python_requires=">=3.8",
2121
install_requires = [
2222
'torch',
2323
'torchvision',
@@ -27,5 +27,7 @@
2727
'pandas',
2828
'Pillow',
2929
'scikit-learn',
30-
'opencv-python']
30+
'opencv-python',
31+
'torch_geometric',
32+
'ogb']
3133
)

0 commit comments

Comments
 (0)