Tensorflow Tutorials using Jupyter Notebook

Overview

Tensorflow Tutorials using Jupyter Notebook

TensorFlow tutorials written in Python (of course) with Jupyter Notebook. Tried to explain as kindly as possible, as these tutorials are intended for TensorFlow beginners. Hope these tutorials to be a useful recipe book for your deep learning projects. Enjoy coding! :)

Contents

  1. Basics of TensorFlow / MNIST / Numpy / Image Processing / Generating Custom Dataset
  2. Machine Learing Basics with TensorFlow: Linear Regression / Logistic Regression with MNIST / Logistic Regression with Custom Dataset
  3. Multi-Layer Perceptron (MLP): Simple MNIST / Deeper MNIST / Xavier Init MNIST / Custom Dataset
  4. Convolutional Neural Network (CNN): Simple MNIST / Deeper MNIST / Simple Custom Dataset / Basic Custom Dataset
  5. Using Pre-trained Model (VGG): Simple Usage / CNN Fine-tuning on Custom Dataset
  6. Recurrent Neural Network (RNN): Simple MNIST / Char-RNN Train / Char-RNN Sample / Hangul-RNN Train / Hangul-RNN Sample
  7. Word Embedding (Word2Vec): Simple Version / Complex Version
  8. Auto-Encoder Model: Simple Auto-Encoder / Denoising Auto-Encoder / Convolutional Auto-Encoder (deconvolution)
  9. Class Activation Map (CAM): Global Average Pooling on MNIST
  10. TensorBoard Usage: Linear Regression / MLP / CNN
  11. Semantic segmentation
  12. Super resolution (in progress)
  13. Web crawler
  14. Gaussian process regression
  15. Neural Style
  16. Face detection with OpenCV

Requirements

  • TensorFlow
  • Numpy
  • SciPy
  • Pillow
  • BeautifulSoup
  • Pretrained VGG: inside 'data/' folder

Note

Most of the codes are simple refactorings of Aymeric Damien's Tutorial or Nathan Lintz's Tutorial. There could be missing credits. Please let me know.

Collected and Modifyed by Sungjoon

info

Comments
  • TypeError: Input 'b' of 'MatMul' Op has type float32 that does not match type int32 of argument 'a'.

    TypeError: Input 'b' of 'MatMul' Op has type float32 that does not match type int32 of argument 'a'.

    I've followed the tutorial, but after the step of # Construct the variables for the NCE loss, which it's the block code of

    with tf.device('/cpu:0'):
        # Loss function 
        num_sampled = 64        # Number of negative examples to sample. 
        loss = tf.reduce_mean(
            tf.nn.nce_loss(nce_weights, nce_biases, embed
                           , train_labels, num_sampled, vocabulary_size))
        # Optimizer
        optm = tf.train.GradientDescentOptimizer(1.0).minimize(loss)
        # Similarity measure (important)
        norm = tf.sqrt(tf.reduce_sum(tf.square(embeddings), 1, keep_dims=True))
        normalized_embeddings = embeddings / norm
        valid_embeddings = tf.nn.embedding_lookup(normalized_embeddings
                        , valid_dataset)
        siml = tf.matmul(valid_embeddings, normalized_embeddings
                        , transpose_b=True)
        
    print ("Functions Ready")
    
    

    Got the error of TypeError: Input 'b' of 'MatMul' Op has type float32 that does not match type int32 of argument 'a'.

    opened by davidoak 2
  • Fix changed tensorflow API

    Fix changed tensorflow API

    In word2vec_basic, word2vec_simple

    from tf.nn.nce_loss(nce_weights, nce_biases, embed, train_labels, num_sampled, vocabulary_size)) to tf.nn.nce_loss(nce_weights, nce_biases, train_labels, embed, num_sampled, vocabulary_size))

    from summary_writer = tf.train.SummaryWriter('/tmp/tf_logs/word2vec', graph=sess.graph) to summary_writer = tf.summary.FileWriter('/tmp/tf_logs/word2vec', graph=sess.graph)

    from tf.initialize_all_variables().run() to sess.run(tf.initialize_all_variables())

    opened by bzantium 0
  • mlp_mnist_simple.ipynb => `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

    mlp_mnist_simple.ipynb => `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

    About https://github.com/sjchoi86/Tensorflow-101/blob/master/notebooks/mlp_mnist_simple.ipynb

    Recently updated Tensorflow (1.4) will make the following error.

    ValueError: Only call softmax_cross_entropy_with_logits with named arguments (labels=..., logits=..., ...)

    Just simply adding named arguments will solve this issue.

    cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits =pred, labels=y))

    FYI, http://www.edwith.org/deeplearningchoi/lecture/15552/ has the right code.

    opened by aydenkim 1
  • i have the 100 percent accuracy!

    i have the 100 percent accuracy!

    I have done my own dataset and with the first step of training, i have the 100 percent accuracy for test and train data!! it was impossible I think, I search for the mistake in my code but I didn't find it! do you think where is my mistake?

    opened by setare94 0
  • clarify the version of pre-requisite packages

    clarify the version of pre-requisite packages

    Hi, @sjchoi86 ,

    Thank you very much for releasing such a useful repos. As it's been quite a time since you first released this repos, so some conflict may occur when running this repos with current TF (0.12.1 or 1.0).

    For example, when I run "semseg_basic.pynb" at the last cell, I came across this TF error

    In order to run this repos, could you clarify the version of pre-requisite packages?

    Tensorflow version: 0.xx? python version: 2.7/3.4/3.5 ? cuda version: 7.0/7.5/8.0? cudnn version ? anaconda: used or not?

    THX!

    opened by amiltonwong 0
  • How to deal with huge data?

    How to deal with huge data?

    I'm currently trying to generate a dataset based on your tutorial, but i was wondering how to deal with a huge data(10 gb of images). My laptop can't handle the huge amount of data(because the tutorial told us that we need to store the data into array variable first). Is there anyway to handle this? Thanks

    opened by aryopg 10
Owner
Sungjoon
Assistant professor at Korea University
Sungjoon
This Jupyter notebook shows one way to implement a simple first-order low-pass filter on sampled data in discrete time.

How to Implement a First-Order Low-Pass Filter in Discrete Time We often teach or learn about filters in continuous time, but then need to implement t

Joshua Marshall 4 Aug 24, 2022
Simple tutorials on Pytorch DDP training

pytorch-distributed-training Distribute Dataparallel (DDP) Training on Pytorch Features Easy to study DDP training You can directly copy this code for

Ren Tianhe 188 Jan 6, 2023
The Incredible PyTorch: a curated list of tutorials, papers, projects, communities and more relating to PyTorch.

This is a curated list of tutorials, projects, libraries, videos, papers, books and anything related to the incredible PyTorch. Feel free to make a pu

Ritchie Ng 9.2k Jan 2, 2023
Pytorch tutorials for Neural Style transfert

PyTorch Tutorials This tutorial is no longer maintained. Please use the official version: https://pytorch.org/tutorials/advanced/neural_style_tutorial

Alexis David Jacq 135 Jun 26, 2022
Pytorch Geometric Tutorials

Pytorch Geometric Tutorials

Antonio Longa 648 Jan 8, 2023
Useful materials and tutorials for 110-1 NTU DBME5028 (Application of Deep Learning in Medical Imaging)

Useful materials and tutorials for 110-1 NTU DBME5028 (Application of Deep Learning in Medical Imaging)

null 7 Jun 22, 2022
A colab notebook for training Stylegan2-ada on colab, transfer learning onto your own dataset.

Stylegan2-Ada-Google-Colab-Starter-Notebook A no thrills colab notebook for training Stylegan2-ada on colab. transfer learning onto your own dataset h

Harnick Khera 66 Dec 16, 2022
This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CNPs), Neural Processes (NPs), Attentive Neural Processes (ANPs).

The Neural Process Family This repository contains notebook implementations of the following Neural Process variants: Conditional Neural Processes (CN

DeepMind 892 Dec 28, 2022
Deploy tensorflow graphs for fast evaluation and export to tensorflow-less environments running numpy.

Deploy tensorflow graphs for fast evaluation and export to tensorflow-less environments running numpy. Now with tensorflow 1.0 support. Evaluation usa

Marcel R. 349 Aug 6, 2022
TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

null 2.6k Jan 4, 2023
Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Peter Lin 6.5k Jan 4, 2023
Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Robust Video Matting (RVM) English | 中文 Official repository for the paper Robust High-Resolution Video Matting with Temporal Guidance. RVM is specific

flow-dev 2 Aug 21, 2022
📚 A collection of Jupyter notebooks for learning and experimenting with OpenVINO 👓

A collection of ready-to-run Python* notebooks for learning and experimenting with OpenVINO developer tools. The notebooks are meant to provide an introduction to OpenVINO basics and teach developers how to leverage our APIs for optimized deep learning inference in their applications.

OpenVINO Toolkit 840 Jan 3, 2023
Jupyter notebooks for the code samples of the book "Deep Learning with Python"

Jupyter notebooks for the code samples of the book "Deep Learning with Python"

François Chollet 16.2k Dec 30, 2022
Library extending Jupyter notebooks to integrate with Apache TinkerPop and RDF SPARQL.

Graph Notebook: easily query and visualize graphs The graph notebook provides an easy way to interact with graph databases using Jupyter notebooks. Us

Amazon Web Services 501 Dec 28, 2022
Human head pose estimation using Keras over TensorFlow.

RealHePoNet: a robust single-stage ConvNet for head pose estimation in the wild.

Rafael Berral Soler 71 Jan 5, 2023
Unofficial TensorFlow implementation of Protein Interface Prediction using Graph Convolutional Networks.

[TensorFlow] Protein Interface Prediction using Graph Convolutional Networks Unofficial TensorFlow implementation of Protein Interface Prediction usin

YeongHyeon Park 9 Oct 25, 2022
Using Tensorflow Object Detection API to detect Waymo open dataset

Waymo-2D-Object-Detection Using Tensorflow Object Detection API to detect Waymo open dataset Result CenterNet Training Loss SSD ResNet Training Loss C

null 76 Dec 12, 2022