All Projects → rusty1s → Pytorch_scatter

rusty1s / Pytorch_scatter

Licence: mit
PyTorch Extension Library of Optimized Scatter Operations

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorch scatter

segment-liftover
Lifterover copy number segments in whole
Stars: ✭ 20 (-96.76%)
Mutual labels:  segment
Jxpagelistview
高仿闲鱼、转转、京东、中央天气预报等主流APP列表底部分页滚动视图
Stars: ✭ 377 (-39%)
Mutual labels:  segment
Ninapagerview
Stars: ✭ 545 (-11.81%)
Mutual labels:  segment
analytics-js-without-segment
A toolset to use Segments open-source analytics library (analytics.js) WITHOUT using the paid Segment service (segment.com). To be used with your favorite analytics-tools like Google Analytics, Mixpanel, Hotjar, etc.
Stars: ✭ 47 (-92.39%)
Mutual labels:  segment
Kafka Go
Kafka library in Go
Stars: ✭ 4,200 (+579.61%)
Mutual labels:  segment
Wmzpagecontroller
分页控制器,替换UIPageController方案,具备完整的生命周期,多种指示器样式,多种标题样式,可悬浮,支持ios13暗黑模式(仿优酷,爱奇艺,今日头条,简书,京东等多种标题菜单) (Pagination controller with full life cycle, multiple indicator styles, multiple title styles)
Stars: ✭ 405 (-34.47%)
Mutual labels:  segment
HandyNet
Akshay Rangesh and Mohan M. Trivedi, "HandyNet: A One-stop Solution to Detect, Segment, Localize & Analyze Driver Hands," IEEE Conference on Computer Vision and Pattern Recognition - 3D HUMANS Workshop, 2018.
Stars: ✭ 14 (-97.73%)
Mutual labels:  segment
Jxcategoryview
A powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
Stars: ✭ 5,561 (+799.84%)
Mutual labels:  segment
Baisibudejie
百思不得姐4.5.6版本高仿
Stars: ✭ 339 (-45.15%)
Mutual labels:  segment
Mynlp
一个生产级、高性能、模块化、可扩展的中文NLP工具包。(中文分词、平均感知机、fastText、拼音、新词发现、分词纠错、BM25、人名识别、命名实体、自定义词典)
Stars: ✭ 519 (-16.02%)
Mutual labels:  segment
auto-analytics
UNMAINTAINED! - Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for JavaScript applications.
Stars: ✭ 28 (-95.47%)
Mutual labels:  segment
Cga.js
CGA 3D 计算几何算法库 | 3D Compute Geometry Algorithm Library webgl three.js babylon.js等任何库都可以使用
Stars: ✭ 313 (-49.35%)
Mutual labels:  segment
Easysegmentedbarview
本库主要提供一个简单易用的自定义分段控件,方便快速实现分段效果,支持xml配置、代码配置、分段规则按均分/比例分、数字分段、文本分段、渐变分段、bar条样式正常/圆形/三角形,segment文字样式、进度设置、进度标记类型设置、分段描述设置、其它更多自定义设置等功能。
Stars: ✭ 455 (-26.38%)
Mutual labels:  segment
KPSmartTabBar
A fully customisable and flexible tab bar controller
Stars: ✭ 37 (-94.01%)
Mutual labels:  segment
Pinterestsegment
A Pinterest-like segment control with masking animation.
Stars: ✭ 560 (-9.39%)
Mutual labels:  segment
VGSegment
A segment menu with line animation
Stars: ✭ 19 (-96.93%)
Mutual labels:  segment
Sppagemenu
分页菜单,功能非常齐全,满足绝大多数APP,简书地址:
Stars: ✭ 402 (-34.95%)
Mutual labels:  segment
Driveway
pure CSS masonry layouts
Stars: ✭ 607 (-1.78%)
Mutual labels:  segment
Hvscrollview
这不是框架,只是3个示例程序,给大家提供一个实现这种布局的思路
Stars: ✭ 584 (-5.5%)
Mutual labels:  segment
Redux Segment
Segment.io analytics integration for redux.
Stars: ✭ 517 (-16.34%)
Mutual labels:  segment

PyTorch Scatter

PyPI Version Build Status Docs Status Code Coverage


Documentation

This package consists of a small extension library of highly optimized sparse update (scatter and segment) operations for the use in PyTorch, which are missing in the main package. Scatter and segment operations can be roughly described as reduce operations based on a given "group-index" tensor. Segment operations require the "group-index" tensor to be sorted, whereas scatter operations are not subject to these requirements.

The package consists of the following operations with reduction types "sum"|"mean"|"min"|"max":

In addition, we provide the following composite functions which make use of scatter_* operations under the hood: scatter_std, scatter_logsumexp, scatter_softmax and scatter_log_softmax.

All included operations are broadcastable, work on varying data types, are implemented both for CPU and GPU with corresponding backward implementations, and are fully traceable.

Installation

Binaries

We provide pip wheels for all major OS/PyTorch/CUDA combinations, see here.

PyTorch 1.8.0

To install the binaries for PyTorch 1.8.0, simply run

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+${CUDA}.html

where ${CUDA} should be replaced by either cpu, cu101, cu102, or cu111 depending on your PyTorch installation.

cpu cu101 cu102 cu111
Linux
Windows
macOS

PyTorch 1.7.0/1.7.1

To install the binaries for PyTorch 1.7.0 and 1.7.1, simply run

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.7.0+${CUDA}.html

where ${CUDA} should be replaced by either cpu, cu92, cu101, cu102, or cu110 depending on your PyTorch installation.

cpu cu92 cu101 cu102 cu110
Linux
Windows
macOS

Note: Binaries of older versions are also provided for PyTorch 1.4.0, PyTorch 1.5.0 and PyTorch 1.6.0 (following the same procedure).

From source

Ensure that at least PyTorch 1.5.0 is installed and verify that cuda/bin and cuda/include are in your $PATH and $CPATH respectively, e.g.:

$ python -c "import torch; print(torch.__version__)"
>>> 1.5.0

$ echo $PATH
>>> /usr/local/cuda/bin:...

$ echo $CPATH
>>> /usr/local/cuda/include:...

Then run:

pip install torch-scatter

When running in a docker container without NVIDIA driver, PyTorch needs to evaluate the compute capabilities and may fail. In this case, ensure that the compute capabilities are set via TORCH_CUDA_ARCH_LIST, e.g.:

export TORCH_CUDA_ARCH_LIST = "6.0 6.1 7.2+PTX 7.5+PTX"

Example

import torch
from torch_scatter import scatter_max

src = torch.tensor([[2, 0, 1, 4, 3], [0, 2, 1, 3, 4]])
index = torch.tensor([[4, 5, 4, 2, 3], [0, 0, 2, 2, 1]])

out, argmax = scatter_max(src, index, dim=-1)
print(out)
tensor([[0, 0, 4, 3, 2, 0],
        [2, 4, 3, 0, 0, 0]])

print(argmax)
tensor([[5, 5, 3, 4, 0, 1]
        [1, 4, 3, 5, 5, 5]])

Running tests

python setup.py test

C++ API

torch-scatter also offers a C++ API that contains C++ equivalent of python models.

mkdir build
cd build
# Add -DWITH_CUDA=on support for the CUDA if needed
cmake ..
make
make install
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].