A past blog post explored using multi-layer-perceptrons (MLP) to predict stock prices using Tensorflow and Python. This post introduces another common library used for artificial neural networks (ANN) and other numerical purposes: Theano. An MLP Python class is created implemented using Theano, and then the performance of the class is compared with the TFANN class in a benchmark.

# tensorflow

# Image Classification Using Convolutional Neural Networks in TensorFlow

This blog post introduces a type of neural network called a convolutional neural network (CNN) using Python and TensorFlow. A brief introduction to CNNs is given and a helper class for building CNNs in Python and TensorFlow is provided. The source code from this post is available here on GitHub.

# Visualizing Neural Network Performance on High-Dimensional Data

This post presents a short script that plots neural network performance on high-dimensional binary data using MatPlotLib in Python. Binary vectors, or vectors only containing 0 and 1, can be useful for representing categorical data or discrete phenomena. The code in this post is available on GitHub.

# Stock Market Prediction Using Multi-Layer Perceptrons With TensorFlow

In this post a multi-layer perceptron (MLP) class based on the TensorFlow library is discussed. The class is then applied to the problem of performing stock prediction given historical data. **Note:** This post is not meant to characterize how stock prediction is actually done; it is intended to demonstrate the TensorFlow library and MLPs. **Update:** See part 2 of this series for more examples of using python and TensorFlow for performing stock prediction. **Update 2****: **See a later postÂ Visualizing Neural Network Performance on High-Dimensional Data for code to help visualize neural network learning and performance.

### Data Setup

The data used in this post was collected from finance.yahoo.com. The data consists of historical stock data from Yahoo Inc. over the period of the 12th of April 1996 to the 19th of April 2016. The data can be downloaded as a CSV file from the provided link. To pre-process the data for the neural network, first transform the dates into integer values using LibreOffice’s DATEVALUE function. A screen-shot of the transformed data can be seen as follows: