We talked about auto-encoder here and here with R (https://charleshsliao.wordpress.com/2017/04/14/identify-arguments-of-h2o-deep-learning-model-with-tuned-auto-encoder-in-r-with-mnist/). We also talked about the three functions of auto encoder above. This is a pretty standard example used for benchmarking anomaly detection models. We use Python3 and H2O framework to build auto-encoder. More details can be found in Sebastian Raschka’s book: https://www.goodreads.com/book/show/25545994-python-machine-learning?ac=1&from_search=true import pandas as […]

# 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 […]

# A CNN Model with TensorFlow in R with API

We built the simple model in last article, we will build a more sophisticated model with TensorFlow. This article is more like practicing and the code comes from: https://rstudio.github.io/tensorflow/index.html Sys.setenv(TENSORFLOW_PYTHON=”/usr/local/bin/python”) # point to python 2.7 (self-installed, not the default one of OSX) library(tensorflow) ###basically we do the simple MNIST again except that we use interactive […]

# 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 […]

# Train Deep Learning Model with R Studio in AWS EC2

AWS provides us with approachable GPU based cloud computing capability with minimal cost. We will talk about the steps to take advantage of AWS EC2 to build GPU computing for our model training in R. 1. Register AWS account… 2. Find EC2 service 3. Click “launch instance” and go for this one labeled Free tier […]

# 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. […]

# Applying Temporal Difference Methods to Machine Learning — Part 3

In this third Part of Applying Temporal Difference Methods to Machine Learning, I will be experimenting with the intra-sequence update variant of TD learning. It is a method where after each time step, the parameters are updated rather than waiting at the end of the sequence. This post relates to my class project for the Reinforcement […]

# Applying Temporal Difference Methods to Machine Learning — Part 2

In this Part 2 of Applying Temporal Difference Methods to Machine Learning, I will show results of applying what Sutton refers to the traditional machine learning approach compared to the Temporal Difference approach. For more information on this series, refer to the first part. An important consideration with regard to the problem I am using […]

# A H2O FNN Model for MNIST

Please read this first:https://charleshsliao.wordpress.com/2017/04/14/identify-arguments-of-h2o-deep-learning-model-with-tuned-auto-encoder-in-r-with-mnist/ Following the auto encoder results of arguments in last article and a sample FNN model at the end of that article, we can build a full FNN model for MNIST. library(jsonlite) library(caret) library(h2o) library(ggplot2) library(data.table) load_image_file <- function(filename) { ret = list() f = file(filename,’rb’) readBin(f,’integer’,n=1,size=4,endian=’big’) ret$n = readBin(f,’integer’,n=1,size=4,endian=’big’) nrow = […]

# 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 […]