Browse Source

PR #3 autograph -> autogl

rename autograph to autogl
tags/v0.3.1
Frozenmad GitHub 5 years ago
parent
commit
d68d9396c0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 40 deletions
  1. +2
    -13
      autogl/datasets/__init__.py
  2. +4
    -4
      autogl/datasets/utils.py
  3. +0
    -7
      autogl/module/model/__init__.py
  4. +0
    -10
      autogl/module/train/__init__.py
  5. +3
    -3
      autogl/module/train/graph_classification.py
  6. +3
    -3
      autogl/module/train/node_classification.py

+ 2
- 13
autogl/datasets/__init__.py View File

@@ -17,7 +17,7 @@ DATASET_DICT = {}

def register_dataset(name):
"""
New dataset types can be added to autograph with the :func:`register_dataset`
New dataset types can be added to autogl with the :func:`register_dataset`
function decorator.

For example::
@@ -37,7 +37,7 @@ def register_dataset(name):
pyg and not issubclass(cls, torch_geometric.data.Dataset)
):
raise ValueError(
"Dataset ({}: {}) must extend autograph.data.Dataset".format(
"Dataset ({}: {}) must extend autogl.data.Dataset".format(
name, cls.__name__
)
)
@@ -106,17 +106,6 @@ from .utils import (
graph_get_split,
)

"""
# automatically import any Python files in the datasets/ directory
for file in os.listdir(os.path.dirname(__file__)):
if file.endswith(".py") and not file.startswith("_"):
dataset_name = file[: file.find(".py")]
if not pyg and dataset_name.startswith("pyg"):
continue
module = importlib.import_module("autograph.datasets." + dataset_name)
"""


def build_dataset(args, path="~/.cache-autogl/"):
path = osp.join(path, "data", args.dataset)
path = os.path.expanduser(path)


+ 4
- 4
autogl/datasets/utils.py View File

@@ -168,7 +168,7 @@ def random_splits_mask_class(


def graph_cross_validation(dataset, n_splits=10, shuffle=True, random_seed=42):
r"""Cross validation for graph classification data, returning one fold with specific idx in autograph.datasets or pyg.Dataloader(default)
r"""Cross validation for graph classification data, returning one fold with specific idx in autogl.datasets or pyg.Dataloader(default)

Parameters
----------
@@ -315,7 +315,7 @@ def graph_get_split(dataset, mask="train", is_loader=True, batch_size=128):
return with which dataset/dataloader

is_loader : bool
return with autograph.datasets or pyg.Dataloader
return with autogl.datasets or pyg.Dataloader

batch_size : int
batch_size for generateing Dataloader
@@ -332,7 +332,7 @@ def graph_get_split(dataset, mask="train", is_loader=True, batch_size=128):

'''
def graph_cross_validation(dataset, n_splits = 10, shuffle = True, random_seed = 42, fold_idx = 0, batch_size = 32, dataloader = True):
r"""Cross validation for graph classification data, returning one fold with specific idx in autograph.datasets or pyg.Dataloader(default)
r"""Cross validation for graph classification data, returning one fold with specific idx in autogl.datasets or pyg.Dataloader(default)

Parameters
----------
@@ -355,7 +355,7 @@ def graph_cross_validation(dataset, n_splits = 10, shuffle = True, random_seed =
batch_size for generateing Dataloader

dataloader : bool
return with autograph.datasets or pyg.Dataloader
return with autogl.datasets or pyg.Dataloader
"""
skf = StratifiedKFold(n_splits=n_splits, shuffle = shuffle, random_state = random_seed)
idx_list = []


+ 0
- 7
autogl/module/model/__init__.py View File

@@ -17,13 +17,6 @@ def register_model(name):

return register_model_cls


# automatically import any Python files in this directory
# for file in os.listdir(os.path.dirname(__file__)):
# if file.endswith(".py") and not file.startswith("_"):
# file_name = file[: file.find(".py")]
# module = importlib.import_module("autograph.module.model." + file_name)

from .base import BaseModel
from .topkpool import AutoTopkpool
from .graphsage import AutoSAGE


+ 0
- 10
autogl/module/train/__init__.py View File

@@ -36,16 +36,6 @@ def register_evaluate(*name):

return register_evaluate_cls


"""
# automatically import any Python files in this directory
for file in os.listdir(os.path.dirname(__file__)):
if file.endswith(".py") and not file.startswith("_"):
file_name = file[: file.find(".py")]
module = importlib.import_module("autograph.module.train." + file_name)
"""


def get_feval(feval):
if isinstance(feval, str):
return EVALUATE_DICT[feval]


+ 3
- 3
autogl/module/train/graph_classification.py View File

@@ -214,7 +214,7 @@ class GraphClassificationTrainer(BaseTrainer):

Returns
-------
self: ``autograph.train.GraphClassificationTrainer``
self: ``autogl.train.GraphClassificationTrainer``
A reference of current trainer.

"""
@@ -289,7 +289,7 @@ class GraphClassificationTrainer(BaseTrainer):

Returns
-------
self: ``autograph.train.GraphClassificationTrainer``
self: ``autogl.train.GraphClassificationTrainer``
A reference of current trainer.

"""
@@ -507,7 +507,7 @@ class GraphClassificationTrainer(BaseTrainer):

Returns
-------
self: ``autograph.train.GraphClassificationTrainer``
self: ``autogl.train.GraphClassificationTrainer``
A new instance of trainer.

"""


+ 3
- 3
autogl/module/train/node_classification.py View File

@@ -191,7 +191,7 @@ class NodeClassificationTrainer(BaseTrainer):

Returns
-------
self: ``autograph.train.NodeClassificationTrainer``
self: ``autogl.train.NodeClassificationTrainer``
A reference of current trainer.

"""
@@ -261,7 +261,7 @@ class NodeClassificationTrainer(BaseTrainer):

Returns
-------
self: ``autograph.train.NodeClassificationTrainer``
self: ``autogl.train.NodeClassificationTrainer``
A reference of current trainer.

"""
@@ -456,7 +456,7 @@ class NodeClassificationTrainer(BaseTrainer):

Returns
-------
self: ``autograph.train.NodeClassificationTrainer``
self: ``autogl.train.NodeClassificationTrainer``
A new instance of trainer.

"""


Loading…
Cancel
Save