Skip to content

Commit

Permalink
Convert to a usable package
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-alertedh committed Oct 2, 2017
1 parent a4debae commit eb6f953
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 11 deletions.
Empty file added dnc/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions access.py → dnc/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
3 changes: 1 addition & 2 deletions access_test.py → dnc/access_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion addressing.py → dnc/addressing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions addressing_test.py → dnc/addressing_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion dnc.py → dnc/dnc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions train.py → dnc/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion util_test.py → dnc/util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import numpy as np
import tensorflow as tf

import util
from dnc import util


class BatchInvertPermutation(tf.test.TestCase):
Expand Down
52 changes: 52 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from setuptools import setup

setup(
name='sample',

# 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'],
)

0 comments on commit eb6f953

Please sign in to comment.