RNN, LSTM in TensorFlow for NLP in Python

We covered RNN for MNIST data, and it is actually even more suitable for NLP projects. You can find more details on Valentino Zocca, Gianmario Spacagna, Daniel Slater’s book Python Deep Learning. from __future__ import print_function, division # -*- coding: utf-8 -*- ###”War and peace” contains more than 500,000 words, making it the perfect ###candidate […]

Continue reading


DNN and CNN of Keras with MNIST Data in Python

We talked about some examples of CNN application with KeRas for Image Recognition and Quick Example of CNN with KeRas with Iris Data. Actually, TensorFlow itself in Python is mature enough to conduct deep learning activities and KeRas is even faster and more simple to train with than TensorFlow only in deep learning activities. You […]

Continue reading


CNN Model of Image Detection in Keras (TensorFlow) in Python3

This article covers the basic application of Keras and CNN in Python3, with Sublime text3 and Ipython Notebook as IDE. More details of the following code can be found in Robert Layton’s book here: https://www.goodreads.com/book/show/26019855-learning-data-mining-with-python?from_search=true ###The book above said that we will build a system that will take an image as an input ###and give […]

Continue reading


Keras in Python, Backend TensorFlow, with Iris data to Build Deep Learning Model

We talked about Deep Learning Modeling in TensorFlow in Python&R: https://charleshsliao.wordpress.com/2017/06/06/rnn-in-tensorflow-in-pythonr-with-mnist/ We also mentioned Keras application in R: https://charleshsliao.wordpress.com/2017/04/24/cnndnn-of-keras-in-r-backend-tensorflow-for-mnist/ This article covers the basic application of Keras and TensorFlow in Python3, with Sublime text3 and Ipython Notebook as IDE. More details of the following code can be found in Robert Layton’s book here: https://www.goodreads.com/book/show/26019855-learning-data-mining-with-python?from_search=true ###This […]

Continue reading


RNN in TensorFlow in Python&R, with MNIST

Thought it is more convenient to conduct TensorFlow framework in python, we also talked about how to imply Tensorflow in R here:https://charleshsliao.wordpress.com/tag/tensorflow/ We will talk about how to apply Recurrent neural network in TensorFlow on both of python and R. in R: #1. We load the data library(tensorflow) mnist<-tf$contrib$learn$datasets$mnist$load_mnist(train_dir = “MNIST-data”) #2.Identify Essential Parameters Input<-28L […]

Continue reading


Multi Layer Perceptrons in Python

You can see more about MLP in R here:https://charleshsliao.wordpress.com/2017/04/10/tune-multi-layer-perceptron-mlp-in-r-with-mnist/ Generally speaking, a deep learning model means a neural network model with more than just one hidden layer. Whether a deep learning model would be successful depends largely on the parameters tuned. We use the data from sklearn library, and the IDE is sublime text3. Most […]

Continue reading


Build Perceptron to Classify Iris Data with Python

It would be interesting to write some basic neuron function for classification, helping us refresh some essential points in neural network. Used sublime text3 and Ipython3 as IDE, and the code mostly came from: https://www.goodreads.com/book/show/25545994-python-machine-learning?from_search=true import pandas as pd df=pd.read_csv(‘iris.data’, header=None) def rstr(df): return df.shape, df.apply(lambda x:[x.unique()]) print(df.tail()) print(rstr(df)) import matplotlib.pyplot as plt import numpy […]

Continue reading


A Quick TensorFLow Example with R API

This is an example for MNIST Neural Network model(DNN) with TensorFlow in R with API. Sys.setenv(TENSORFLOW_PYTHON=”/usr/local/bin/python”) # point to python 2.7 (self-installed, not the default one of OSX) library(tensorflow) ###1. load default mnist data datasets<-tf$contrib$learn$datasets mnist<-datasets$mnist$read_data_sets(“MNIST-data”,one_hot=TRUE) #Instead of running a single expensive operation independently from R, #TensorFlow lets us describe a graph of interacting operations […]

Continue reading


CNN/DNN of KeRas in R, Backend Tensorflow, for MNIST

Keras is a library of tensorflow, and they are both developed under python. We can approach to both of the libraries in R after we install the according packages. Of course, we need to install tensorflow and keras at first with terminal (I am using a MAC), and they can function best with python 2.7. […]

Continue reading


Identify Arguments of H2O Deep Learning Model with Tuned Auto Encoder in R with MNIST

Auto-encode can be trained to learn the deep or hidden features of data. These hidden features may be used on their own, such as to better understand the structure of data, or for other applications. Two common applications of auto-encoders and unsupervised learning are to identify anomalous data (for example, outlier detection, financial fraud) and […]

Continue reading