{"id":19932124,"url":"https://github.com/amazon-science/mlp-rank-pruning","last_synced_at":"2026-03-07T06:02:27.913Z","repository":{"id":235131620,"uuid":"788115928","full_name":"amazon-science/mlp-rank-pruning","owner":"amazon-science","description":"MLP-Rank: A graph theoretical approach to structured pruning of deep neural networks based on weighted Page Rank centrality as introduced by the related thesis.","archived":false,"fork":false,"pushed_at":"2024-04-22T09:57:54.000Z","size":62,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-09T05:10:12.693Z","etag":null,"topics":["centrality-measures","graph-theory","inference-optimization","machine-learning","multilayer-perceptron","neural-network","pagerank","pruning","structured-sparsity","weighted-pagerank"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amazon-science.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-17T20:03:10.000Z","updated_at":"2024-11-19T12:39:48.000Z","dependencies_parsed_at":"2024-04-22T11:10:31.713Z","dependency_job_id":null,"html_url":"https://github.com/amazon-science/mlp-rank-pruning","commit_stats":null,"previous_names":["amazon-science/mlp-rank-pruning"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/amazon-science/mlp-rank-pruning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fmlp-rank-pruning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fmlp-rank-pruning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fmlp-rank-pruning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fmlp-rank-pruning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-science","download_url":"https://codeload.github.com/amazon-science/mlp-rank-pruning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fmlp-rank-pruning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30208801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["centrality-measures","graph-theory","inference-optimization","machine-learning","multilayer-perceptron","neural-network","pagerank","pruning","structured-sparsity","weighted-pagerank"],"created_at":"2024-11-12T23:09:10.573Z","updated_at":"2026-03-07T06:02:27.892Z","avatar_url":"https://github.com/amazon-science.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MLP-Rank: A Graph Theoretical Approach to Pruning Deep Neural Networks\n\nThis is the PyTorch implementation of pruning neural networks based on the weighted PageRank centrality measure as introduced by my thesis:\n\n\u003e **MLP-Rank: A Graph Theoretical Approach to Pruning Deep Neural Networks** \\\n\u003e Amazon Web Services - AI Research and Education \\\n\u003e Author: David B. Hoffmann \\\n\u003e Advisor: Dr. Kailash Budhathoki, Dr. Matthäus Kleindessner \\\n\n```bibtex\n@mastersthesis{hoffmann2024mlprank,\n    type={Bachelor's Thesis},\n    title={MLP-Rank: A Graph Theoretical Approach to Pruning Deep Neural Networks},\n    author={Hoffmann, David B.},\n    year={2024},\n}\n```\n\n## Setup\n\nTo setup mlp-rank-pruning, clone the repository and install it locally with `pip install -e .`.\n\n## How To Use\n\nThe package provides everything needed to train and prune mulilayer perceptron networks as done in the thesis. It contains a **training** module which can be used to conduct distributed hyperparameter optimisation over a simple grid as well as training of single MLP model, for image classification tasks. For further documentation related to training refer to the [training README](https://gitlab.aws.dev/adavidho/mlp-rank-pruning/-/blob/main/training/README.md?ref_type=heads). Note that the code in the training folder is subject to a separate license, which is provided in that folder. \\\nThe **mlprank** package contains everything related to pruning a pretrained neural network. It is designed to be easily extendible and compatible with further methods and scoring functions for structured pruning to allow for other comparisons, which is further detailed in the [architecture README](https://gitlab.aws.dev/adavidho/mlp-rank-pruning/-/blob/main/mlprank/architectures/README.md?ref_type=heads). The core function of the mlprank package is prune_mlp, which is documented in the [mlprank README](https://gitlab.aws.dev/adavidho/mlp-rank-pruning/-/blob/main/mlprank/README.md?ref_type=heads). To do structured pruning using weighted PageRank centrality on a simple three layer MLP using MNIST as calibration data, the following code can be used: \n```python\nfrom mlprank import prune_mlp\n\nmetrics, scores = prune_mlp(\n    model_name=\"TwoLayerMLP\",\n    dataset_name=\"MNIST\",\n    method_name=\"Local\",\n    measure_name=\"WeightedPageRank\",\n    amount=0.3,\n    out_path=\".\"\n)\n```\nThe **experiment** module acts as a CLI tool for running multiple experiments. It takes a list of fixed and iterable arguments for different networks, scoring functions, pruning methods and pruning amounts and calls the `mlprank.prune_mlp` method. For more details refer to the [experiment README](https://gitlab.aws.dev/adavidho/mlp-rank-pruning/-/blob/main/experiments/README.md?ref_type=heads). \n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-science%2Fmlp-rank-pruning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-science%2Fmlp-rank-pruning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-science%2Fmlp-rank-pruning/lists"}