This repository includes python code and jupyter notebook for an introduction to Convolution Neural Network (CNN) and Recurrent Neural Network (RNN).
The notebooks have been tested using miniconda3 with python3.6 and python3.5.
Latest Keras (>=v2.0.9) is required to run the RNN code, which uses the RNN
class.
To run the notebooks, here are some instructions
- install the dependent libraries including, keras + tensorflow, jupyter notebook and others in requirements.txt
conda install tensorflow
# or with gpu
conda install tensorflow-gpu
git clone https://github.com/fchollet/keras.git
cd keras
python setup.py install
conda install --file requirements.txt
- create the checkpoint folder,
ckpt
anddata/
folder. - download the dataset into
data/
folder. Details are inside the notebooks.
Here are the instructions to setup the GPU instance on Amazon AWS. NOTE: select the nearest AWS region with GPU, e.g. Singapore. You can use cheaper GPU instances like g2.2xlarge. You can also use Google Cloud, which has GPUs in Region Taiwan.
We adapt code from keras example and fast.ai courses to creat the notebooks.
- MNIST CNN, CNN and RNN for sentiment analysis, Char RNN, Seq2Seq are from keras.
- CNN fine-tune is from fast.ai.