Skip to content

Commit cfc6002

Browse files
committed
import numpy lab2
1 parent 5dbded2 commit cfc6002

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

mitdeeplearning/util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import tensorflow as tf
33
import time
44
import progressbar
5+
import numpy as np
56

67
from IPython import display as ipythondisplay
78
from string import Formatter
@@ -21,18 +22,20 @@ def plot_sample(x,y,vae):
2122
plt.figure(figsize=(2,1))
2223
plt.subplot(1, 2, 1)
2324

24-
idx = np.where(y.numpy()==1)[0][0]
25+
idx = np.where(y==1)[0][0]
2526
plt.imshow(x[idx])
2627
plt.grid(False)
2728

2829
plt.subplot(1, 2, 2)
2930
_, _, _, recon = vae(x)
31+
recon = np.clip(recon, 0, 1)
3032
plt.imshow(recon[idx])
3133
plt.grid(False)
3234

3335
plt.show()
3436

3537

38+
3639
class LossHistory:
3740
def __init__(self, smoothing_factor=0.0):
3841
self.alpha = smoothing_factor

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ def get_dist(pkgname):
2121
setup(
2222
name = 'mitdeeplearning', # How you named your package folder (MyLib)
2323
packages = ['mitdeeplearning'], # Chose the same as "name"
24-
version = '0.4.5', # Start with a small number and increase it with every change you make
24+
version = '0.4.6', # Start with a small number and increase it with every change you make
2525
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
2626
description = 'Official software labs for MIT Introduction to Deep Learning (http://introtodeeplearning.com)', # Give a short description about your library
2727
author = 'Alexander Amini', # Type in your name
2828
author_email = '[email protected]', # Type in your E-Mail
2929
url = 'http://introtodeeplearning.com', # Provide either the link to your github or to your website
30-
download_url = 'https://github.com/aamini/introtodeeplearning_labs/archive/v0.4.5.tar.gz', # I explain this later on
30+
download_url = 'https://github.com/aamini/introtodeeplearning_labs/archive/v0.4.6.tar.gz', # I explain this later on
3131
keywords = ['deep learning', 'neural networks', 'tensorflow', 'introduction'], # Keywords that define your package best
3232
install_requires=install_deps,
3333
classifiers=[

0 commit comments

Comments
 (0)