跳转到主要内容

🍇 GRAPE 是一个用于预测和评估的 Rust/Python 图表示学习库。

项目描述

Pypi project Pypi total project downloads Tutorials Documentation Supported Python versions License Telegram Group Discord Server Twitter

GRAPE (Graph Representation leArning, Predictions and Evaluation) 是一个快速图处理和嵌入库,旨在扩展到大型图,并可在台式机和笔记本电脑以及高性能计算工作站集群上运行。

该库是用 RustPython 编程语言编写的,由 AnacletoLAB (米兰大学计算机科学系) 开发,并与 Robinson 实验室 - 杰克逊基因组医学实验室 以及 BBOP - 伯克利国家实验室 合作开发。

该库由两个主要模块组成,Ensmallen,这是一个 Rust/Python 高性能图处理子模块,以及 Embiggen,这是一个 Python 图表示学习、预测和评估子模块。

GRAPE 的安装

通常,只需运行以下命令从 PyPi 安装它

pip install grape

通常,安装不会超过一分钟。

可以在任何支持Rust和LLVM的操作系统、libc版本和CPU架构(例如Arm、AArch64、RiscV、Mips)上手动编译Ensmallen。如果您需要帮助,请打开一个问题。

库的主要功能

Features

教程

您可以在这里找到覆盖GRAPE库各个方面的教程。所有教程尽可能独立,可以在COLAB上立即执行。

如果您认为任何示例可能有所帮助,请随时在GitHub上打开一个问题,描述本教程中缺少的内容

文档

在线文档(目前正在更新中)

库的在线文档可以在这里找到。由于Ensmallen是用Rust编写的,而PyO3(我们用于Python绑定的包)不支持类型,文档是通过生成一个空骨架包来获得的。这允许您拥有适当的文档,但您无法在其中看到源代码。

使用自动方法建议实用工具

为了帮助您使用该库,GRAPE提供了一个集成推荐系统,旨在帮助您找到一种方法,或者如果由于任何原因方法被重命名,找到其新名称。

例如,在加载了STRING 人源图之后,可以通过简单地输入components来检索计算连通组件的函数

from grape.datasets.string import HomoSapiens

graph = HomoSapiens()
graph.components

上面的代码将引发以下错误,并建议具有相似或相关名称的方法

AttributeError                            Traceback (most recent call last)
<ipython-input-3-52fac30ac7f6> in <module>()
----> 2 graph.components

AttributeError: The method 'components' does not exists, did you mean one of the following?
* 'remove_components'
* 'connected_components'
* 'strongly_connected_components'
* 'get_connected_components_number'
* 'get_total_edge_weights'
* 'get_mininum_edge_weight'
* 'get_maximum_edge_weight'
* 'get_unchecked_maximum_node_degree'
* 'get_unchecked_minimum_node_degree'
* 'get_weighted_maximum_node_degree'

在我们的例子中,用于计算图组件的方法将是connected_components

现在获取方法文档的最简单方法是使用Python的帮助,如下所示

help(graph.connected_components)

上述操作将返回以下内容

connected_components(verbose) method of builtins.Graph instance
Compute the connected components building in parallel a spanning tree using [bader's algorithm](https://www.sciencedirect.com/science/article/abs/pii/S0743731505000882).

**This works only for undirected graphs.**

The returned quadruple contains:
- Vector of the connected component for each node.
- Number of connected components.
- Minimum connected component size.
- Maximum connected component size.

Parameters
----------
verbose: Optional[bool]
    Whether to show a loading bar or not.


Raises
-------
ValueError
    If the given graph is directed.
ValueError
    If the system configuration does not allow for the creation of the thread pool.

引用GRAPE

如果该文档对您的研究有所帮助,请引用以下论文

@article{cappelletti2023grape,
  title={GRAPE for Fast and Scalable Graph Processing and random walk-based Embedding},
  author={Cappelletti, L. and Fontana, T. and Casiraghi, E. and Ravanmehr, V. and  Callahan, T.J. and  Cano, C. and Joachimiak, M.P. and Mungall, C.J. and Robinson, P.N. and Reese, J. and Valentini, G.},
  year={2023},
  doi={10.1038/s43588-023-00465-8},
  journal={Nature Computational Science}}

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。

源代码分发

grape-0.2.4.tar.gz (8.5 kB 查看哈希值)

上传时间 源代码

由以下组织支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面