From 56d10369432ab2f63dad9ace3b905398f770dd98 Mon Sep 17 00:00:00 2001 From: Charles Martin Date: Tue, 7 May 2024 15:20:59 +1000 Subject: [PATCH] change import name of the package to keras_mdn_layer --- README.md | 4 +-- examples/1-sineprediction.py | 2 +- examples/4-robojam-touch-generation.py | 2 +- {mdn => keras_mdn_layer}/__init__.py | 0 {mdn => keras_mdn_layer}/tests/__init__.py | 0 {mdn => keras_mdn_layer}/tests/test_mdn.py | 2 +- {mdn => keras_mdn_layer}/version.py | 0 notebooks/context.py | 2 +- requirements.txt | 35 ---------------------- 9 files changed, 6 insertions(+), 41 deletions(-) rename {mdn => keras_mdn_layer}/__init__.py (100%) rename {mdn => keras_mdn_layer}/tests/__init__.py (100%) rename {mdn => keras_mdn_layer}/tests/test_mdn.py (98%) rename {mdn => keras_mdn_layer}/version.py (100%) delete mode 100644 requirements.txt diff --git a/README.md b/README.md index 157638b..ad23cda 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This project requires Python 3.6+, TensorFlow and TensorFlow Probability. You ca python3 -m pip install keras-mdn-layer -And finally, import the `mdn` module in Python: `import mdn` +And finally, import the module in Python: `import keras_mdn_layer as mdn` Alternatively, you can clone or download this repository and then install via `python setup.py install`, or copy the `mdn` folder into your own project. @@ -47,7 +47,7 @@ And finally, for learning how to generate musical touch-screen performances with The MDN layer should be the last in your network and you should use `get_mixture_loss_func` to generate a loss function. Here's an example of a simple network with one Dense layer followed by the MDN. from tensorflow import keras - import mdn + import keras_mdn_layer as mdn N_HIDDEN = 15 # number of hidden units in the Dense layer N_MIXES = 10 # number of mixture components diff --git a/examples/1-sineprediction.py b/examples/1-sineprediction.py index e0bd25d..296cf04 100644 --- a/examples/1-sineprediction.py +++ b/examples/1-sineprediction.py @@ -1,6 +1,6 @@ # Normal imports for everybody from tensorflow import keras -import mdn +import keras_mdn_layer as mdn import numpy as np diff --git a/examples/4-robojam-touch-generation.py b/examples/4-robojam-touch-generation.py index ecb29f9..81d1531 100644 --- a/examples/4-robojam-touch-generation.py +++ b/examples/4-robojam-touch-generation.py @@ -8,7 +8,7 @@ import random import time import pandas as pd -import mdn +import keras_mdn_layer as mdn import matplotlib.pyplot as plt diff --git a/mdn/__init__.py b/keras_mdn_layer/__init__.py similarity index 100% rename from mdn/__init__.py rename to keras_mdn_layer/__init__.py diff --git a/mdn/tests/__init__.py b/keras_mdn_layer/tests/__init__.py similarity index 100% rename from mdn/tests/__init__.py rename to keras_mdn_layer/tests/__init__.py diff --git a/mdn/tests/test_mdn.py b/keras_mdn_layer/tests/test_mdn.py similarity index 98% rename from mdn/tests/test_mdn.py rename to keras_mdn_layer/tests/test_mdn.py index 33c8103..8fdb2b5 100644 --- a/mdn/tests/test_mdn.py +++ b/keras_mdn_layer/tests/test_mdn.py @@ -1,5 +1,5 @@ from tensorflow.compat.v1 import keras -import mdn +import keras_mdn_layer as mdn import numpy as np diff --git a/mdn/version.py b/keras_mdn_layer/version.py similarity index 100% rename from mdn/version.py rename to keras_mdn_layer/version.py diff --git a/notebooks/context.py b/notebooks/context.py index e6bbcda..150bc91 100644 --- a/notebooks/context.py +++ b/notebooks/context.py @@ -4,5 +4,5 @@ import sys import os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) -import mdn +import keras_mdn_layer as mdn from tensorflow import keras diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 68ce77e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,35 +0,0 @@ -absl-py==0.8.1 -astor==0.8.0 -cachetools==3.1.1 -certifi==2019.9.11 -chardet==3.0.4 -cloudpickle==1.1.1 -decorator==4.4.1 -gast==0.2.2 -google-auth==1.6.3 -google-auth-oauthlib==0.4.1 -google-pasta==0.1.7 -grpcio==1.24.3 -h5py==2.10.0 -idna==2.8 -Keras-Applications==1.0.8 -Keras-Preprocessing==1.1.0 -Markdown==3.1.1 -numpy==1.17.3 -oauthlib==3.1.0 -opt-einsum==3.1.0 -protobuf==3.10.0 -pyasn1==0.4.7 -pyasn1-modules==0.2.7 -requests==2.22.0 -requests-oauthlib==1.2.0 -rsa==4.0 -six==1.12.0 -tensorboard==2.0.1 -tensorflow==2.0.1 -tensorflow-estimator==2.0.1 -tensorflow-probability==0.8.0 -termcolor==1.1.0 -urllib3==1.25.6 -Werkzeug==0.16.0 -wrapt==1.11.2