GL-Coarsener, a graph learning based coarsening method
Project description
GL-Coarsener
A python implementation of GL-Coarsener method, as proposed in GL-Coarsener: A Graph representation learning framework to construct coarse grid hierarchy for AMG solvers, arXiv:2011.09994.
If you find our code or paper useful in your research, please consider citing:
@misc{namazi2020glcoarsener,
title={GL-Coarsener: A Graph representation learning framework to construct coarse grid hierarchy for AMG solvers},
author={Reza Namazi and Arsham Zolanvari and Mahdi Sani and Seyed Amir Ali Ghafourian Ghahramani},
year={2020},
eprint={2011.09994},
archivePrefix={arXiv},
primaryClass={math.NA}
}
Installation
pip install gl-coarsener
Usage
Import the package
from glcoarsener import Coarsener
Input
You should construct a Coarsener object with the adjacency matrix that you want to coarsen. The input must be of type scipy sparse CSR matrix.
from scipy import sparse
adjacency_matrix = sparse.random(1000, 1000, format='csr')
Applying the method
coarsener = Coarsener(adjacency_matrix)
coarse_adjacency_matrix = coarsener.apply(
dimensions=100,
walk_length=20,
num_walks=10,
p=0.1,
q=1,
number_of_clusters=adjacency_matrix.shape.shape[0] // 5,
clustering_method='kmeans',
workers=1
)
print(coarse_adjacency_matrix)
Contributing
Any contribution is greatly appreciated. If you think you can improve this work, please open a pull request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/Improvement
) - Commit your Changes (
git commit -m 'Add some Improvement'
) - Push to the Branch (
git push origin feature/Improvement
) - Open a Pull Request
Contact
If you have any questions, please do not hesitate to contact me:
- Personal Webpage: https://rezanmz.com/
- Email: rezanmz@ymail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gl_coarsener-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c3ebc6ab2f37226ea68c3fb9513ceaec5e606e3f252292983785113f7d66d9a |
|
MD5 | 7cd146b8d3ec7dde8f68ea3e9fce0438 |
|
BLAKE2b-256 | fc192513ace92f225e84a7fe6d4632ea0d73a1aae8c3bd30cbad919d8f8ed896 |