From 7090bc34ac190c93eabf4c78d3caa7e1c9b42f2b Mon Sep 17 00:00:00 2001 From: Alexander Amini Date: Fri, 24 Jan 2020 21:19:38 -0500 Subject: [PATCH] unit test lab 1 --- mitdeeplearning/lab1.py | 7 +++++++ setup.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mitdeeplearning/lab1.py b/mitdeeplearning/lab1.py index 1e32b6cc..20486ad9 100644 --- a/mitdeeplearning/lab1.py +++ b/mitdeeplearning/lab1.py @@ -77,3 +77,10 @@ def test_batch_func_next_step(func, args): assert (x[:,1:] == y[:,:-1]).all(), "[FAIL] test_batch_func_next_step: x_{t} must equal y_{t-1} for all t" print("[PASS] test_batch_func_next_step") return True + +def test_custom_dense_layer_output(y): + true_y = np.array([[0.2697859, 0.45750418, 0.66536945]],dtype='float32') + assert tf.shape(y).numpy().tolist() == list(true_y.shape), "[FAIL] output is of incorrect shape. expected {} but got {}".format(true_y.shape, y.numpy().shape) + assert np.array_equal(y.numpy(), true_y), "[FAIL] output is of incorrect value. expected {} but got {}".format(y.numpy(), y.numpy()) + print("[PASS] test_custom_dense_layer_output") + return True diff --git a/setup.py b/setup.py index c4a94d07..97c961fc 100644 --- a/setup.py +++ b/setup.py @@ -22,13 +22,13 @@ def get_dist(pkgname): setup( name = 'mitdeeplearning', # How you named your package folder (MyLib) packages = ['mitdeeplearning'], # Chose the same as "name" - version = '1.0.0', # Start with a small number and increase it with every change you make + version = '0.1.0', # Start with a small number and increase it with every change you make license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository description = 'Official software labs for MIT Introduction to Deep Learning (http://introtodeeplearning.com)', # Give a short description about your library author = 'Alexander Amini', # Type in your name author_email = 'introtodeeplearning-staff@mit.edu', # Type in your E-Mail url = 'http://introtodeeplearning.com', # Provide either the link to your github or to your website - download_url = 'https://github.com/aamini/introtodeeplearning/archive/v1.0.0.tar.gz', # I explain this later on + download_url = 'https://github.com/aamini/introtodeeplearning/archive/v0.1.0.tar.gz', # I explain this later on keywords = ['deep learning', 'neural networks', 'tensorflow', 'introduction'], # Keywords that define your package best install_requires=install_deps, classifiers=[