You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ebfd167
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -10,7 +10,7 @@ please following the :doc:`instruction </start/contribution>` guide.
10
10
Usage
11
11
-----------------------
12
12
13
-
If your network is OK, you can directly use any of datasets in :doc:`/api/data` as following:
13
+
If your network is OK, you can directly use any of the datasets in :doc:`/api/data` as follows:
14
14
15
15
.. code-block:: python
16
16
@@ -149,36 +149,208 @@ The architecture of constructing DHG's dataset object is shown in the following
149
149
150
150
Build Your Own Dataset
151
151
-----------------------
152
-
Coming soon...
153
152
153
+
At first you should inherit your data class from the :py:class:`BaseData <dhg.data.BaseData>` class.
154
154
155
+
.. code-block:: python
156
+
157
+
>>>from dhg.data import BaseData
158
+
159
+
All the items in the dataset are configured in the ``_content`` dictionary. Currently, the following items are supported:
160
+
161
+
- download from remote server -> load from local file -> preprocess and return
162
+
- load from local file -> preprocess and return
163
+
- directly return
155
164
156
-
.. Prepare Dataset
157
-
.. -----------------
165
+
The supported loader functions can be found in :ref:`here <api_datapipe_loader>`.
158
166
159
-
.. Use the intergrated dataset
160
-
.. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167
+
The supported preprocess functions can be found in :ref:`here <api_datapipe_preprocess>`.
161
168
162
-
.. Currently, DHG includes the following datasets:
169
+
If the ``item`` should be downloaded from a remote server, you should specify the ``upon``, ``loader``, and ``preprocess`` keys in the ``_content`` dictionary.
170
+
The ``upon`` key is a list of dictionaries, each dictionary at lease contains the ``filename`` and ``md5`` keys.
171
+
The ``filename`` is the name of the file to be downloaded, and the ``md5`` is the md5 checksum of the file.
172
+
Defaultly, remote file is stored in the ``REMOTE_DATASETS_ROOT \ data_root \ name \ filename`` directory.
Copy file name to clipboardExpand all lines: docs/source/tutorial/structure.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,8 +59,8 @@ Common Methods
59
59
[0., 0., 0., 1., 0.]])
60
60
61
61
You can find that the adjacency matrix of the simple graph is a symmetric matrix.
62
-
The ``g.e`` attribute will return a tuple of two lists, the first list is the edge list and the second list is a list of weight for each edge.
63
-
The ``g.e_both_size`` attribute will return the both side of edges in the simple graph.
62
+
The :py:attr:`g.e <dhg.Graph.e>` attribute will return a tuple of two lists, the first list is the edge list and the second list is a list of weight for each edge.
63
+
The :py:attr:`g.e_both_side <dhg.Graph.e_both_side>` attribute will return the both side of edges in the simple graph.
0 commit comments