diff --git a/dnc/__init__.py b/dnc/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/access.py b/dnc/access.py similarity index 99% rename from access.py rename to dnc/access.py index f4a8433..7dc43df 100644 --- a/access.py +++ b/dnc/access.py @@ -19,11 +19,11 @@ from __future__ import print_function import collections + import sonnet as snt import tensorflow as tf -import addressing -import util +from dnc import addressing AccessState = collections.namedtuple('AccessState', ( 'memory', 'read_weights', 'write_weights', 'linkage', 'usage')) diff --git a/access_test.py b/dnc/access_test.py similarity index 99% rename from access_test.py rename to dnc/access_test.py index 79df2f4..d295dd6 100644 --- a/access_test.py +++ b/dnc/access_test.py @@ -22,8 +22,7 @@ import tensorflow as tf from tensorflow.python.ops import rnn -import access -import util +from dnc import access, util BATCH_SIZE = 2 MEMORY_SIZE = 20 diff --git a/addressing.py b/dnc/addressing.py similarity index 99% rename from addressing.py rename to dnc/addressing.py index 77a88e8..69f773e 100644 --- a/addressing.py +++ b/dnc/addressing.py @@ -19,10 +19,11 @@ from __future__ import print_function import collections + import sonnet as snt import tensorflow as tf -import util +from dnc import util # Ensure values are greater than epsilon to avoid numerical instability. _EPSILON = 1e-6 diff --git a/addressing_test.py b/dnc/addressing_test.py similarity index 99% rename from addressing_test.py rename to dnc/addressing_test.py index d8f803d..53eeb6f 100644 --- a/addressing_test.py +++ b/dnc/addressing_test.py @@ -22,8 +22,7 @@ import sonnet as snt import tensorflow as tf -import addressing -import util +from dnc import addressing, util class WeightedSoftmaxTest(tf.test.TestCase): diff --git a/dnc.py b/dnc/dnc.py similarity index 99% rename from dnc.py rename to dnc/dnc.py index 8df92cf..853d841 100644 --- a/dnc.py +++ b/dnc/dnc.py @@ -23,11 +23,12 @@ from __future__ import print_function import collections + import numpy as np import sonnet as snt import tensorflow as tf -import access +from dnc import access DNCState = collections.namedtuple('DNCState', ('access_output', 'access_state', 'controller_state')) diff --git a/repeat_copy.py b/dnc/repeat_copy.py similarity index 100% rename from repeat_copy.py rename to dnc/repeat_copy.py diff --git a/train.py b/dnc/train.py similarity index 99% rename from train.py rename to dnc/train.py index a2ca1ad..52b09f1 100644 --- a/train.py +++ b/dnc/train.py @@ -19,10 +19,9 @@ from __future__ import print_function import tensorflow as tf -import sonnet as snt import dnc -import repeat_copy +from dnc import repeat_copy FLAGS = tf.flags.FLAGS diff --git a/util.py b/dnc/util.py similarity index 100% rename from util.py rename to dnc/util.py diff --git a/util_test.py b/dnc/util_test.py similarity index 98% rename from util_test.py rename to dnc/util_test.py index 8cac46c..55e3f25 100644 --- a/util_test.py +++ b/dnc/util_test.py @@ -21,7 +21,7 @@ import numpy as np import tensorflow as tf -import util +from dnc import util class BatchInvertPermutation(tf.test.TestCase): diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..c3f8f44 --- /dev/null +++ b/setup.py @@ -0,0 +1,52 @@ +from setuptools import setup + +setup( + name='dnc', + + # Versions should comply with PEP440. For a discussion on single-sourcing + # the version across setup.py and the project code, see + # https://packaging.python.org/en/latest/single_source_version.html + version='1.0.0', + + description='Differentiable Neural Computer in Tensorflow', + long_description='Differentiable Neural Computer in Tensorflow', + + # The project's main homepage. + url='https://github.com/deepmind/dnc', + + # Author details + author='Google Inc.', + + # Choose your license + license='Apache License 2.0', + + classifiers=[ + 'Development Status :: 4 - Beta', + + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: Science/Research', + + 'Topic :: Scientific/Engineering :: Mathematics', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + + 'License :: OSI Approved :: Apache Software License', + + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + ], + + # What does your project relate to? + keywords='tensorflow differentiable neural computer dnc deepmind deep mind sonnet dm-sonnet machine learning', + + # You can just specify the packages manually here if your project is + # simple. Or you can use find_packages(). + packages=['dnc'], + install_requires=['dm-sonnet'], +)