Predict code for Penn Bank Tree (ptb) dataset

  Predict code is pretty much the same with Predict code for simple sequence dataset, so I won’t explain in detail.   Code The code is on the github, predict_ptb.py.

    Given the first text by the index, args.primeindex, model will predict the following sequence as word id. The last three line converts the […]

Continue reading →

Training LSTM model with Penn Bank Tree (ptb) dataset

  This post mainly explains train_ptb.py, uploaded on github.   We have already learned RNN and LSTM network architecture, let’s apply it to PTB dataset. It is quite similar to train_simple_sequence.py explained in Training RNN with simple sequence dataset, so no much explanation is necessary.   Train code I will just paste whole the training code […]

Continue reading →

Penn Tree Bank (PTB) dataset introduction

  This post is based on the jupyter notebook ptb_dataset_introduction.ipynb uploaded on github. Penn Treebank dataset, known as PTB dataset, is widely used in machine learning of NLP (Natural Language Processing) research. Dataset if provided by the official page: Treebank-3 In Chainer, PTB dataset can be obtained with build-in function. Let’s see the dataset structure.  

[…]

Continue reading →

Setup IDE

  If this is the first time to use python and you have not built any python development environment, setting up IDE (Integrated Development Environment) might be a one good choice to start coding quite easily. I will introduce how to setup PyCharm, one of the major python development tool, which I am also using […]

Continue reading →

Chainer sklearn wrapper

  If you are familiar with machine learning before deep learning becomes popular, you might have been using sklearn (scikit-learn), which is very popular machine learning library in python. Its interface is used for a long time, and I thought it is better to support this interface with python to allow users to try deep learning more […]

Continue reading →

Install Chainer

  Once you have setup python environment, now we can install chainer. Nowadays it is important for deep learning library to use GPU to enhance its calculation speed, and Chainer provides several levels of GPU support. The packages which you need to install depends on your PC envitonment, please follow this figure to understand what category you […]

Continue reading →

Setup python environment

    ※ This post is mainly just a summary/translation of the Japanese blog, データサイエンティストを目指す人のpython環境構築 2016   TL;DR; I recommend to install “anaconda” instead of using “official python package”.   If you just want to proceed environment setup, jump to “Environment setup for each OS”. At first, I will explain little bit about the background […]

Continue reading →

Write predict code using concat_examples

  This tutorial corresponds to 03_custom_dataset_mlp folder in the source code.   We have trained the model with own dataset, MyDataset, in previous post, let’s write predict code. Source code: predict_custom_dataset1.py predict_custom_dataset2.py   Prepare test data It is not difficult for the model to fit to the train data, so we will check how the model is […]

Continue reading →

Training code for MyDataset

  This tutorial corresponds to 03_custom_dataset_mlp folder in the source code. We have prepared your own dataset, MyDataset, in previous post. Training procedure for this dataset is now almost same with MNIST traning. Differences from MNIST dataset are, This task is regression task (estimate final “value”), instead of classification task (estimate the probability of category) Training […]

Continue reading →