Skip to content

Commit 8a61d6c

Browse files
committed
add setup.py and uploaded the library to PyPI so that it can be installed throught pip
1 parent daa90dd commit 8a61d6c

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,17 @@ Please contact us if you have a related paper and we would be glad to add it to
2525

2626

2727
## Usage
28-
Please first clone the PyHessian library to your local system:
28+
### Install from Pip
29+
You can install the library from pip
30+
```
31+
pip install pyhessian
32+
```
33+
34+
### Install from source
35+
You can also compile the library from source
2936
```
3037
git clone https://github.com/amirgholami/PyHessian.git
38+
python setup.py install
3139
```
3240

3341
Before running the Hessian code, we need a (pre-trained) NN model. Here, we provide a training file to train ResNet20 model on Cifar-10 dataset:

setup.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from setuptools import setup
2+
3+
setup(
4+
# Needed to silence warnings (and to be a worthwhile package)
5+
name='PyHessian',
6+
url='https://github.com/amirgholami/PyHessian',
7+
author='Zhewei Yao, Amir Gholami',
8+
9+
# Needed to actually package something
10+
packages=['pyhessian'],
11+
# Needed for dependencies
12+
install_requires=['numpy', 'torch'],
13+
# Others
14+
version='0.0.1',
15+
license='MIT',
16+
description='Pytorch library for second-order based analysis and training of Neural Networks',
17+
)

0 commit comments

Comments
 (0)