Untitled

 avatar
unknown
python
2 years ago
2.9 kB
7
Indexable
class CoorderMeesho(BaseData):
    r"""
    The content of the CoorderMeesho dataset includes the following:

    - ``num_classes``: The number of classes: :math:`2`.
    - ``num_vertices``: The number of vertices: :math:`66,790`.
    - ``num_edges``: The number of edges: :math:`27528`.
    - ``dim_features``: The dimension of features: :math:`10`.
    - ``features``: The vertex feature matrix. ``torch.Tensor`` with size :math:`(66, 790 \times 10)`.
    - ``edge_list``: The edge list. ``List`` with length :math:`27528`.
    - ``labels``: The label list. ``torch.LongTensor`` with size :math:`(66,790, )`.
    - ``train_mask``: The train mask. ``torch.BoolTensor`` with size :math:`(66,790, )`.
    - ``val_mask``: The validation mask. ``torch.BoolTensor`` with size :math:`(66,790, )`.
    - ``test_mask``: The test mask. ``torch.BoolTensor`` with size :math:`(66,790, )`.

    Args:
        ``data_root`` (``str``, optional): The ``data_root`` has stored the data. If set to ``None``, this function will auto-download from server and save into the default direction ``~/.dhg/datasets/``. Defaults to ``None``.
    """
    def __init__(self, data_root: Optional[str] = None) -> None:
        super().__init__("coorder_meesho", data_root)
        self._content = {
            "num_classes": 2,
            "num_vertices": 66790,
            "num_edges": 27528,
            "dim_features": 10,
            "features": {
                "upon": [{"filename": features,
                          "md5": "1b00a68b983d48bd57e7203d905da27a",}],
                "loader": load_from_pickle,
                "preprocess": [to_tensor, partial(norm_ft, ord=1)],
            },
            "edge_list": {
                "upon": [{"filename": edge_list,
                          "md5": "4492346f6776ab5f57fd2f85fb1e8fcd",}],
                "loader": load_from_pickle,
            },
            "labels": {
                "upon": [{"filename": labels,
                          "md5": "a972ba9aa9045ea9d6ca3e6a1f6022e5",}],
                "loader": load_from_pickle,
                "preprocess": [to_long_tensor],
            },
            "train_mask": {
                "upon": [{"filename": train_mask,
                          "md5": "8a05bd0e00183c64824b20e0bb28e65f",}],
                "loader": load_from_pickle,
                "preprocess": [to_bool_tensor],
            },
            "val_mask": {
                "upon": [{"filename": val_mask,
                          "md5": "eef08c056ac2fa3353cce714ea95907b",}],
                "loader": load_from_pickle,
                "preprocess": [to_bool_tensor],
            },
            "test_mask": {
                "upon": [{"filename": val_mask,
                          "md5": "a870dae84a8e0aa9aebad4bde1231857",}],
                "loader": load_from_pickle,
                "preprocess": [to_bool_tensor],
            },
        }

Editor is loading...