Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved leap from contrib to root folder #66

Merged
merged 4 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
Each folder in this repository corresponds to a method or tool for transfer/meta-learning. `xfer-ml` is a standalone MXNet library (installable with pip) which largely automates deep transfer learning. The rest of the folders contain research code for a novel method in transfer or meta-learning, implemented in a variety of frameworks (not necessarily in MXNet).

In more detail:
- [xfer-ml](xfer-ml): A library that allows quick and easy transfer of knowledge stored in deep neural networks implemented in MXNet. xfer-ml can be used with data of arbitrary numeric format, and can be applied to the common cases of image or text data. It can be used as a pipeline that spans from extracting features to training a repurposer. The repurposer is then an object that carries out predictions in the target task. You can also use individual components of the library as part of your own pipeline. For example, you can leverage the feature extractor to extract features from deep neural networks or ModelHandler, which allows for quick building of neural networks, even if you are not an MXNet expert.
- [xfer-ml](xfer-ml): A library that allows quick and easy transfer of knowledge stored in deep neural networks implemented in MXNet. xfer-ml can be used with data of arbitrary numeric format, and can be applied to the common cases of image or text data. It can be used as a pipeline that spans from extracting features to training a repurposer. The repurposer is then an object that carries out predictions in the target task. You can also use individual components of the library as part of your own pipeline. For example, you can leverage the feature extractor to extract features from deep neural networks or ModelHandler, which allows for quick building of neural networks, even if you are not an MXNet expert.
- [leap](leap): MXNet implementation of "leap", the meta-gradient path learner published in ICLR 2019: [(link)](https://arxiv.org/abs/1812.01054) by S. Flennerhag, P. G. Moreno, N. Lawrence, A. Damianou.
jnkm marked this conversation as resolved.
Show resolved Hide resolved


Navigate to the corresponding folder for more details.

Expand Down
40 changes: 40 additions & 0 deletions leap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## leap: meta-gradient path learner in MXNet

--------------------------------------------------------------------------------

MXNet implementation of "leap", the meta-gradient path learner published in ICLR 2019: [(link)](https://arxiv.org/abs/1812.01054) by S. Flennerhag, P. G. Moreno, N. Lawrence, A. Damianou.


## Getting Started
Check the `demos` and `test` folders.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding link to installing jupyter/jupyter lab.

The mxnet_test seems more like a demo than a test since no checks are done and it cannot be run with any normal test runner (e.g. pytest, unittest). Maybe it can move to the demo folder?

To run the demo notebook, the user currently needs to first install leap but you can get around it with either changing the directory or adding the leap directory to the pythonpath. There doesn't really seem to be a general convention but xfer-ml requires the the package to be installed which I think is fine to continue as a convention for the repo.



## Installation
* __Dependencies:__
Primary dependency is MXNet >=1.2. See all requirements in [setup.py](setup.py).
* __Supported architectures / versions:__
Python 3.6+ on MacOS and Amazon Linux.


- __Install from source:__
To install leap from source, after cloning the repository run the following from the xfer/leap directory:
```
pip install .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-e flag for editable for development. Potentially add separate instructions for development

```

Alternatively you can install with:
```
python setup.py install
```

To confirm installation, run:
```python
>>> import leap
>>> leap.__version__
```
And confirm that version returned matches the expected package version number.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add a request that if this code is used to please cite the paper?

## License

leap is licensed under the [Apache 2.0 License](LICENSE).
379 changes: 379 additions & 0 deletions leap/demos/multitask_leap.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
from . import leap_meta_repurposer # noqa: F401
from .meta_repurposer import MetaRepurposer # noqa: F401
from .leap_meta_repurposer import LeapMetaRepurposer # noqa: F401

from .__version__ import __version__ # noqa: F401
4 changes: 2 additions & 2 deletions xfer-ml/xfer/contrib/__init__.py → leap/leap/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all these files be changed to be 2020?

#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
Expand All @@ -11,4 +11,4 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
# ==============================================================================
from . import xfer_leap # noqa: F401
__version__ = '0.1'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions leap/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[bumpversion]
current_version = 0.1
tag = True
commit = True

[bumpversion:file:leap/__version__.py]

[coverage:run]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The coverage settings can be removed since there won't be CI tests running on this

branch = True
source = leap
omit = ./test/*.py, setup.py
64 changes: 64 additions & 0 deletions leap/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
# ==============================================================================
from setuptools import setup, find_packages
import sys



requires = [
'mxnet>=1.2.0',
'numpy>=1.10.1',
'scikit-learn>=0.19.2',
'matplotlib>=2.2.2'
]


# get __version__ variable
exec(open("leap/__version__.py").read())


# enforce >Python3 for all versions of pip/setuptools
assert sys.version_info >= (3,), 'This package requires Python 3.'


setup(
name='leap',
version=__version__, # noqa
description='Leap meta-learner',
# long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/amzn/xfer/leap',
packages=find_packages(exclude=['test*']),
include_package_data=True,
install_requires=requires,
python_requires='>=3', # requires setuptools>=24.2.0 for packaging and pip>=9.0.0 on download for this to work
license='Apache License 2.0',
classifiers=(
# https://pypi.org/pypi?%3Aaction=list_classifiers
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules'
)
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import mxnet as mx
from mxnet import nd, autograd, gluon

from ..leap import Leap
from ..metalogger import MetaLogger
from leap import Leap
from leap.metalogger import MetaLogger

data_ctx = mx.cpu()
model_ctx = mx.cpu()
Expand Down
4 changes: 0 additions & 4 deletions xfer-ml/xfer/contrib/README.md

This file was deleted.