forked from RyunMi/NCG-Optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
80 lines (74 loc) · 2.24 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
from setuptools import find_packages, setup
import os
import re
install_requires = [
'torch>=1.7.1',
]
def _read(f):
with open(os.path.join(os.path.dirname(__file__), f)) as f_:
return f_.read().strip()
def _read_version():
regexp = re.compile(r"^__version__\W*=\W*'([\d.abrc]+)'")
init_py = os.path.join(
os.path.dirname(__file__), 'ncg_optimizer', '__init__.py'
)
with open(init_py) as f:
for line in f:
match = regexp.match(line)
if match is not None:
return match.group(1)
raise RuntimeError(
'Cannot find version in ncg_optimizer/__init__.py'
)
keywords = [
'ncg-optimizer',
'pytorch',
# Basic optimizers
'LCG',
'FR',
'PRP',
'HS',
'CD',
'DY',
'LS',
'HZ',
'HS-DY',
# line search
'Armijo',
'Curvature',
'Strong Wolfe',
'Weak Wolfe',
'Goldstein',
]
setup(
name='ncg-optimizer',
version=_read_version(),
description='PyTorch optimizer based on nonlinear conjugate gradient method',
long_description='\n\n'.join((_read('README.rst'), _read('CHANGES.rst'))),
long_description_content_type='text/x-rst',
url='https://github.com/RyunMi/NCG-optimizer',
author='Kerun Mi',
author_email='ryunxiaomi@gmail.com',
license='Apache 2',
keywords=keywords,
packages=find_packages(exclude=('tests','correct','examples')),
install_requires=install_requires,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Operating System :: Unix',
'Operating System :: Microsoft :: Windows',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
)