Skip to content

Instantly share code, notes, and snippets.

View rusty1s's full-sized avatar

Matthias Fey rusty1s

View GitHub Profile
@rusty1s
rusty1s / qm9.py
Last active August 31, 2022 00:14
QM9 dataset pre-processing
import os
import os.path as osp
from six.moves import urllib
import errno
import tarfile
from rdkit import Chem
from rdkit.Chem import ChemicalFeatures
from rdkit import RDConfig
import torch
from rdkit.Chem import AllChem # noqa
# Reaches around 92% after 5 epochs.
import torch
import torch.nn.functional as F
from torchvision.datasets import MNIST as MNISTImage
from torchvision.transforms import ToTensor
from torch_geometric.data import InMemoryDataset, Data, DataLoader
from torch_geometric.utils import grid
from torch_geometric.transforms import Cartesian
from torch_geometric.nn import (SplineConv, max_pool, max_pool_x, graclus,
import torch
import torch.nn.functional as F
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
from torch.utils.data import DataLoader
from torch_geometric.utils import grid
from torch_geometric.nn import SplineConv
train_dataset = MNIST('/tmp/MNIST', train=True, transform=ToTensor())

(Visionary) Heterogeneous Graph Training API

We train on the Acquire Valued Shoppers Dataset in order to predict whether a customer will purchase a product again in case he/she has received a coupon for it in the past.

Offer (37):
-----------
id:               int   primary key
quantity          int
value             float
@rusty1s
rusty1s / convert_coo_to_csr.py
Created July 20, 2021 17:32
torch._convert_coo_to_csr benchmark
import os
import wget
import time
import errno
import argparse
import os.path as osp
import torch
from scipy.io import loadmat
@rusty1s
rusty1s / release.md
Last active September 10, 2021 08:02
PyG 2.0.0 Release Notes

PyG 2.0 🎉 🎉 🎉

PyG (PyTorch Geometric) has been moved from my own personal account rusty1s to its own organization account pyg-team to emphasize the ongoing collaboration between TU Dortmund University, Stanford University and many great external contributors. With this, we are releasing PyG 2.0, a new major release that brings sophisticated heterogeneous graph support, GraphGym and many other exciting features to PyG.

Heterogeneous Graph Support

A new minor version release, including further bugfixes, official PyTorch 1.10 support, as well as additional features and operators:

Features

@rusty1s
rusty1s / release-2.1.md
Last active August 17, 2022 10:18
PyG 2.1: Principled aggregations, link-level and temporal samplers, data pipe support, ...
@rusty1s
rusty1s / pyg-lib.md
Last active August 30, 2022 15:39
pyg-lib Roadmap

The first pyg-lib releases focuses on unifying the implementations from torch-sparse and torch-cluster into a single package in order to reduce the number of external low-level library dependencies of PyG. In addition, implementations will be improved, e.g., by out-sourcing common routines into re-usable building blocks, unifiying the interfaces, supporting various data types, biased sampling, etc. New functionality will be integrated for temporal-based learning and GNN acceleration.

Samplers

  • Unify common routines behind re-usable functions (e.g., sampling with/without replacement)
  • Deterministic sampling routines
  • Full support for different data types, e.g., int32, int64, etc
  • Integration of cugraph dependency