Skip to content

Commit

Permalink
util adding torch import
Browse files Browse the repository at this point in the history
  • Loading branch information
aamini committed Jan 6, 2025
1 parent 0afb904 commit 19a80e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mitdeeplearning/util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import matplotlib.pyplot as plt
import tensorflow as tf
import time
import numpy as np

Expand All @@ -8,6 +7,7 @@


def display_model(model):
import tensorflow as tf
tf.keras.utils.plot_model(model, to_file="tmp.png", show_shapes=True)
return ipythondisplay.Image("tmp.png")

Expand All @@ -29,6 +29,7 @@ def plot_sample(x, y, vae, backend='tf'):
recon = np.clip(recon, 0, 1)

elif backend == 'pt':
import torch
y = y.detach().cpu().numpy()
face_indices = np.where(y == 1)[0]
idx = face_indices[0] if len(face_indices) > 0 else 0
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '0.7.2', # Start with a small number and increase it with every change you make
version = '0.7.3', # 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 = '[email protected]', # 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/v0.7.2.tar.gz', # I explain this later on
download_url = 'https://github.com/aamini/introtodeeplearning/archive/v0.7.3.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=[
Expand Down

0 comments on commit 19a80e0

Please sign in to comment.