You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "edw4rdyao (via GitHub)" <gi...@apache.org> on 2024/09/20 13:29:57 UTC
[PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
edw4rdyao opened a new pull request, #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83
Hello everyone!
This PR is derived from the project of [GLCC2024](https://www.gitlink.org.cn/glcc/2024/projects): https://www.gitlink.org.cn/hugegraph/hugegraph/wiki?wiki=graph-ai-1
**Completed Features:**
1. Read graphs from HugeGraph and convert them to DGL format (currently only supports single graph datasets like `Cora`).
2. Implemented various graph learning algorithms (4 models have been added so far, with others under metric testing. For details, please visit [hugegraph-integrate-model-test](https://github.com/edw4rdyao/hugegraph-integrate-model-test/tree/feat/models).
3. Encapsulated training and evaluation into classes to simplify the end-to-end graph learning workflow.
**Additional Notes:**
1. Since the [PGL](https://github.com/PaddlePaddle/PGL) hasn't been updated for a long time, priority is given to integrating the [DGL](https://github.com/dmlc/dgl).
2. Data conversion for multi-graph, heterogeneous graphs, and temporal dynamic graphs, as well as related tasks, are currently under development(**ToDo**).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83#discussion_r1768866640
##########
hugegraph-ml/src/hugegraph_ml/data/hugegraph2dgl.py:
##########
@@ -0,0 +1,83 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import dgl
+import torch
+from pyhugegraph.api.gremlin import GremlinManager
+from pyhugegraph.client import PyHugeClient
+
+
+class HugeGraph2DGL:
+ def __init__(
+ self,
+ ip='127.0.0.1',
+ port="8080",
+ graph='hugegraph',
+ user='admin',
+ pwd='xxx'
+ ):
+ self._client: PyHugeClient = PyHugeClient(
+ ip=ip,
+ port=port,
+ graph=graph,
+ user=user,
+ pwd=pwd
+ )
Review Comment:
Lack optional `graphspace` param here ([PyHugeClient](https://github.com/apache/incubator-hugegraph-ai/blob/8ff13195662407fcc80dd3f6d9687090cb397875/hugegraph-python-client/src/pyhugegraph/client.py#L48) has upgraded to `1.5.0`)
Should update the input param
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
Posted by "edw4rdyao (via GitHub)" <gi...@apache.org>.
edw4rdyao commented on code in PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83#discussion_r1770598556
##########
hugegraph-ml/src/hugegraph_ml/data/hugegraph2dgl.py:
##########
@@ -0,0 +1,84 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import dgl
+import torch
+from pyhugegraph.api.gremlin import GremlinManager
+from pyhugegraph.client import PyHugeClient
+
+
+class HugeGraph2DGL:
+ def __init__(
+ self,
+ ip='127.0.0.1',
+ port="8080",
+ graph='hugegraph',
+ user='admin',
+ pwd='xxx',
Review Comment:
I'm using `"admin"` here because the default config in https://github.com/apache/incubator-hugegraph-ai/blob/main/hugegraph-llm/src/hugegraph_llm/config/config_data.py#L65-L70. However, you're right that using `""` would be more secure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83#discussion_r1769937937
##########
hugegraph-ml/README.md:
##########
@@ -1 +1,123 @@
-
\ No newline at end of file
+ # hugegraph-ml
+
+## Summary
+
+`hugegraph-ml` is a tool that integrates HugeGraph with popular graph learning libraries.
+It implements most graph learning algorithms, enabling users to perform end-to-end graph learning workflows directly from HugeGraph using `hugegraph-ml`.
+Graph data can be read directly from `HugeGraph` and used for tasks such as node embedding, node classification, and graph classification.
+The implemented algorithm models can be found in the [models](./src/hugegraph_ml/models) folder.
+
+
+## Environment Requirements
+
+- python 3.9+
+- hugegraph-server 1.0+
+
+## Preparation
+
+1. Start the HugeGraph database, you can do it via Docker/[Binary packages](https://hugegraph.apache.org/docs/download/download/).
+Refer to [docker-link](https://hub.docker.com/r/hugegraph/hugegraph) & [deploy-doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-server/#31-use-docker-container-convenient-for-testdev) for guidance
+2. Clone this project
+ ```bash
+ git clone https://github.com/apache/incubator-hugegraph-ai.git
+ ```
+3. Install [hugegraph-python-client](../hugegraph-python-client) and [hugegraph_ml](../hugegraph-ml)
+ ```bash
+ cd ./incubator-hugegraph-ai # better to use virtualenv (source venv/bin/activate)
+ pip install ./hugegraph-python-client
+ cd .\hugegraph-ml\
+ pip install -e .
+ ```
+4. Enter the project directory
+ ```bash
+ cd ./hugegraph-ml/src
+ ```
+
+## Examples
+
+### Perform node embedding on the `Cora` dataset using the `DGI` model
+
+Make sure that the Cora dataset is already in your HugeGraph database.
+If not, you can run the `import_graph_from_dgl` function to import the `Cora` dataset from `DGL` into
+the `HugeGraph` database.
+
+```python
+from hugegraph_ml.utils.dgl2hugegraph_utils import import_graph_from_dgl
+
+import_graph_from_dgl("cora")
+```
+
+Run [dgi_example.py](./src/hugegraph_ml/examples/dgi_example.py) to view the example.
+```bash
+python .\hugegraph_ml\examples\dgi_example.py
Review Comment:
same
##########
hugegraph-ml/src/tests/test_tasks/test_node_embed.py:
##########
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+import unittest
Review Comment:
```suggestion
# under the License.
import unittest
```
##########
hugegraph-ml/README.md:
##########
@@ -1 +1,123 @@
-
\ No newline at end of file
+ # hugegraph-ml
+
+## Summary
+
+`hugegraph-ml` is a tool that integrates HugeGraph with popular graph learning libraries.
+It implements most graph learning algorithms, enabling users to perform end-to-end graph learning workflows directly from HugeGraph using `hugegraph-ml`.
+Graph data can be read directly from `HugeGraph` and used for tasks such as node embedding, node classification, and graph classification.
+The implemented algorithm models can be found in the [models](./src/hugegraph_ml/models) folder.
+
+
+## Environment Requirements
+
+- python 3.9+
+- hugegraph-server 1.0+
+
+## Preparation
+
+1. Start the HugeGraph database, you can do it via Docker/[Binary packages](https://hugegraph.apache.org/docs/download/download/).
+Refer to [docker-link](https://hub.docker.com/r/hugegraph/hugegraph) & [deploy-doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-server/#31-use-docker-container-convenient-for-testdev) for guidance
+2. Clone this project
+ ```bash
+ git clone https://github.com/apache/incubator-hugegraph-ai.git
+ ```
+3. Install [hugegraph-python-client](../hugegraph-python-client) and [hugegraph_ml](../hugegraph-ml)
+ ```bash
+ cd ./incubator-hugegraph-ai # better to use virtualenv (source venv/bin/activate)
+ pip install ./hugegraph-python-client
+ cd .\hugegraph-ml\
Review Comment:
maybe keep the unix-style `/` in cmd path?
##########
hugegraph-ml/src/hugegraph_ml/data/hugegraph2dgl.py:
##########
@@ -0,0 +1,84 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import dgl
+import torch
+from pyhugegraph.api.gremlin import GremlinManager
+from pyhugegraph.client import PyHugeClient
+
+
+class HugeGraph2DGL:
+ def __init__(
+ self,
+ ip='127.0.0.1',
+ port="8080",
+ graph='hugegraph',
+ user='admin',
+ pwd='xxx',
Review Comment:
better to use `""` or `admin`?
##########
hugegraph-ml/src/hugegraph_ml/utils/dgl2hugegraph_utils.py:
##########
@@ -0,0 +1,133 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+from dgl.data import CoraGraphDataset, CiteseerGraphDataset, PubmedGraphDataset
+from pyhugegraph.api.graph import GraphManager
+from pyhugegraph.api.schema import SchemaManager
+from pyhugegraph.client import PyHugeClient
+
+
+def clear_all_data(
+ ip='127.0.0.1',
+ port="8080",
+ graph_name='hugegraph',
+ user='admin',
+ pwd='xxx',
Review Comment:
same
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83#discussion_r1768863931
##########
hugegraph-ml/requirements.txt:
##########
@@ -0,0 +1,8 @@
+dgl~=2.2.1
+numpy~=1.24.4
+torch~=2.2.0
+tqdm~=4.66.5
+packaging~=24.1
+torchdata~=0.7.0
+PyYAML~=6.0.2
+pydantic~=2.9.2
Review Comment:
```suggestion
pydantic~=2.9.2
```
##########
hugegraph-ml/README.md:
##########
@@ -1 +1,119 @@
-
\ No newline at end of file
+ # hugegraph-ml
+
+## Summary
+
+`hugegraph-ml` is a tool that integrates HugeGraph with popular graph learning libraries.
+It implements most graph learning algorithms, enabling users to perform end-to-end graph learning workflows directly from HugeGraph using `hugegraph-ml`.
+Graph data can be read directly from `HugeGraph` and used for tasks such as node embedding, node classification, and graph classification.
+The implemented algorithm models can be found in the [models](./src/hugegraph_ml/models) folder.
+
+
+## Environment Requirements
+
+- python 3.9+
+- hugegraph-server 1.0+
+
+## Preparation
+
+1. Start the HugeGraph database, you can do it via Docker/[Binary packages](https://hugegraph.apache.org/docs/download/download/).
+Refer to [docker-link](https://hub.docker.com/r/hugegraph/hugegraph) & [deploy-doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-server/#31-use-docker-container-convenient-for-testdev) for guidance
+2. Clone this project
+ ```bash
+ git clone https://github.com/apache/incubator-hugegraph-ai.git
+ ```
+3. Install [hugegraph-python-client](../hugegraph-python-client) and [hugegraph_ml](../hugegraph-ml)
+ ```bash
+ cd ./incubator-hugegraph-ai # better to use virtualenv (source venv/bin/activate)
+ pip install ./hugegraph-python-client
+ pip install -e .
+ ```
+4. Enter the project directory
+ ```bash
+ cd ./hugegraph-ml/src
+ ```
+
+## Examples
+
+### Perform node embedding on the `Cora` dataset using the `DGI` model
+
+Make sure that the Cora dataset is already in your HugeGraph database.
+If not, you can run the `import_graph_from_dgl` function to import the `Cora` dataset from `DGL` into
+the `HugeGraph` database.
+```python
+from hugegraph_ml.utils.data_import_from_dgl import import_graph_from_dgl
+import_graph_from_dgl("cora")
+```
+
+Run [dgi_example.py](./src/hugegraph_ml/examples/dgi_example.py) to view the example.
+```bash
+python .\hugegraph_ml\examples\dgi_example.py
+```
+
+The specific process is as follows:
+
+**1. Graph data convert**
+
+Convert the graph from `HugeGraph` to `DGL` format.
+```python
+from hugegraph_ml.data.hugegraph2dgl import HugeGraph2DGL
+from hugegraph_ml.models.dgi import DGI
+from hugegraph_ml.models.mlp import MLPClassifier
+from hugegraph_ml.tasks.node_classify import NodeClassify
+from hugegraph_ml.tasks.node_embed import NodeEmbed
+
+hg2d = HugeGraph2DGL()
+graph, graph_info = hg2d.convert_graph(
+ vertex_label="cora_vertex", edge_label="cora_edge", info_vertex_label="cora_info_vertex"
+)
+```
+
+**2. Select model instance**
+
+```python
+model = DGI(n_in_feats=graph_info["n_feat_dim"])
+```
+
+**3. Train model and node embedding**
+
+```python
+node_embed_task = NodeEmbed(graph=graph, graph_info=graph_info, model=model)
+embedded_graph, graph_info = node_embed_task.train_and_embed(
+ add_self_loop=True, n_epochs=300, gpu=0, patience=30
+)
+```
+
+**4. Downstream tasks node classification using MLP**
+
+```python
+model = MLPClassifier(n_in_feat=graph_info["n_feat_dim"], n_out_feat=graph_info["n_classes"])
+node_clf_task = NodeClassify(graph=embedded_graph, graph_info=graph_info, model=model)
+node_clf_task.train(lr=1e-3, n_epochs=400, gpu=0, patience=40)
+print(node_clf_task.evaluate())
+```
+
+**5. Obtain the metrics**
+
+```text
+{'accuracy': 0.82, 'loss': 0.5714246034622192}
+```
+
+### Perform node classification on the `Cora` dataset using the `GRAND` model.
+
+You can refer to the example in the [grand_example.py](./src/hugegraph_ml/examples/grand_example.py)
+
+```python
+from hugegraph_ml.data.hugegraph2dgl import HugeGraph2DGL
+from hugegraph_ml.models.grand import GRAND
+from hugegraph_ml.tasks.node_classify import NodeClassify
+g2d = HugeGraph2DGL()
Review Comment:
```suggestion
from hugegraph_ml.tasks.node_classify import NodeClassify
g2d = HugeGraph2DGL()
```
##########
hugegraph-ml/setup.py:
##########
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import setuptools
+from pkg_resources import parse_requirements
+
+with open("README.md", "r", encoding="utf-8") as fh:
+ long_description = fh.read()
+
+with open("requirements.txt", encoding="utf-8") as fp:
+ install_requires = [str(requirement) for requirement in parse_requirements(fp)]
+
+setuptools.setup(
+ name="hugegraph-ml",
+ version="1.0.0",
Review Comment:
```suggestion
version="1.5.0",
```
maybe we need to unify the version in `hugegraph-ai` (also keep consistent with the apache release version)
##########
hugegraph-ml/src/hugegraph_ml/data/hugegraph2dgl.py:
##########
@@ -0,0 +1,83 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import dgl
+import torch
+from pyhugegraph.api.gremlin import GremlinManager
+from pyhugegraph.client import PyHugeClient
+
+
+class HugeGraph2DGL:
+ def __init__(
+ self,
+ ip='127.0.0.1',
+ port="8080",
+ graph='hugegraph',
+ user='admin',
+ pwd='xxx'
+ ):
+ self._client: PyHugeClient = PyHugeClient(
+ ip=ip,
+ port=port,
+ graph=graph,
+ user=user,
+ pwd=pwd
+ )
Review Comment:
Lack optional `graphspace` param here (python-client has upgraded to `1.5.0`)
Should update the input param
##########
hugegraph-ml/src/hugegraph_ml/models/dgi.py:
##########
@@ -0,0 +1,209 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+Deep Graph Infomax (DGI)
+
+References
+----------
+Paper: https://arxiv.org/abs/1809.10341
+Author's code: https://github.com/PetarV-/DGI
+DGL code: https://github.com/dmlc/dgl/tree/master/examples/pytorch/dgi
+"""
Review Comment:
Nice to see the reference comment 👍🏻
##########
hugegraph-ml/src/hugegraph_ml/__init__.py:
##########
Review Comment:
shall we add license header for the empty `__init__` file?
Maybe we could refer other ASF [Python projects](https://github.com/apache/?q=&type=all&language=python&sort=)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
Posted by "edw4rdyao (via GitHub)" <gi...@apache.org>.
edw4rdyao commented on PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83#issuecomment-2366906483
> Also note the py-lint ci failed
>
> <img alt="image" width="891" src="https://private-user-images.githubusercontent.com/17706099/369671144-dde0b74a-d10a-45e6-ba86-a0c63595838b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjcwMjkxODMsIm5iZiI6MTcyNzAyODg4MywicGF0aCI6Ii8xNzcwNjA5OS8zNjk2NzExNDQtZGRlMGI3NGEtZDEwYS00NWU2LWJhODYtYTBjNjM1OTU4MzhiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTIyVDE4MTQ0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5MjM3NmY0NjUyNDFjOGJlMzc2OGNkYjRlM2M1YmIxMTI1NWQwNWMyOTg2NjViYjI1ZTc2NzVkODA4ZmZjZmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.csS3m6FPIt_5QCyBgxLFLeUlEt3J-NS_F8CM8mekbjU">
pylint failed for the `hugegraph-llm` and `hugegraph-python-client`, should we fix it? Also, should we add pylint CI for `hugegraph-ml` in [workflows](https://github.com/apache/incubator-hugegraph-ai/tree/main/.github/workflows) and [code_format_and_analysis.sh](https://github.com/apache/incubator-hugegraph-ai/blob/main/style/code_format_and_analysis.sh)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding, node classify and graph classify with models based on DGL [incubator-hugegraph-ai]
Posted by "simon824 (via GitHub)" <gi...@apache.org>.
simon824 merged PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83#issuecomment-2367417053
> pylint failed for the `hugegraph-llm` and `hugegraph-python-client`, should we fix it? Also, should we add pylint CI for `hugegraph-ml` in [workflows](https://github.com/apache/incubator-hugegraph-ai/tree/main/.github/workflows?rgh-link-date=2024-09-22T18%3A29%3A54Z) and [code_format_and_analysis.sh](https://github.com/apache/incubator-hugegraph-ai/blob/main/style/code_format_and_analysis.sh?rgh-link-date=2024-09-22T18%3A29%3A54Z)?
It's a bit strange, these issues should have already been addressed. Has the code been updated to the latest version? Let me take a look
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83#discussion_r1770721506
##########
hugegraph-ml/src/hugegraph_ml/data/hugegraph2dgl.py:
##########
@@ -0,0 +1,84 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import dgl
+import torch
+from pyhugegraph.api.gremlin import GremlinManager
+from pyhugegraph.client import PyHugeClient
+
+
+class HugeGraph2DGL:
+ def __init__(
+ self,
+ ip='127.0.0.1',
+ port="8080",
+ graph='hugegraph',
+ user='admin',
+ pwd='xxx',
Review Comment:
> I'm using `"admin"` here because the default config in [`main`/hugegraph-llm/src/hugegraph_llm/config/config_data.py#L65-L70](https://github.com/apache/incubator-hugegraph-ai/blob/main/hugegraph-llm/src/hugegraph_llm/config/config_data.py?rgh-link-date=2024-09-22T17%3A25%3A06Z#L65-L70). However, you're right that using `""` would be more secure.
That's to display a default value on the **UI**, but in reality, using `xxx` is more appropriate (for user understanding), and a default value is used for **non-UI** scenarios
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] feat(ml): node emdedding&classify with models(DGI, JKNet, GRAND, GRACE) based on DGL [incubator-hugegraph-ai]
Posted by "edw4rdyao (via GitHub)" <gi...@apache.org>.
edw4rdyao commented on code in PR #83:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/83#discussion_r1770757549
##########
hugegraph-ml/src/hugegraph_ml/data/hugegraph2dgl.py:
##########
@@ -0,0 +1,84 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import dgl
+import torch
+from pyhugegraph.api.gremlin import GremlinManager
+from pyhugegraph.client import PyHugeClient
+
+
+class HugeGraph2DGL:
+ def __init__(
+ self,
+ ip='127.0.0.1',
+ port="8080",
+ graph='hugegraph',
+ user='admin',
+ pwd='xxx',
Review Comment:
I understand, you're right.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org