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 →

Create dataset class from your own data with DatasetMixin

  This tutorial corresponds to 03_custom_dataset_mlp folder in the source code. In previous chapter we have learned how to train deep neural network using MNIST handwritten digits dataset. However, MNIST dataset has prepared by chainer utility library and you might now wonder how to prepare dataset when you want to use your own data for […]

Continue reading →

Predict code for simple sequence dataset

  Predict code is easy, implemented in First, construct the model and load the trained model parameters,

  Then we only specify the first index (corresponds to word id), primeindex, and generate next index. We can generate next index repeatedly based on the generated index.

The result is the following, successfully generate […]

Continue reading →

Chainer v2 released: difference from v1

  Chainer version 2 has been released on 2017 June 1,  #Chainer v2.0.0 has been released! Memory reduction (33% in ResNet), API clean up, and CuPy as a separate package. — Chainer (@ChainerOfficial) June 1, 2017 This post is a summary of what you need to change in your code for your chainer development. Detail […]

Continue reading →

Training RNN with simple sequence dataset

  We have learned in previous post that RNN is expected to have an ability to remember the sequence information. Let’s do a easy experiment to check it before trying actual NLP application. Simple sequence dataset I just prepared a simple script to generate simple integer sequence as follows, Source code:

Its output is, […]

Continue reading →

CIFAR-10, CIFAR-100 inference code

  The code structure of inference/predict stage is quite similar to MNIST inference code, please read this for precise explanation. Here, I will simply put the code and its results. CIFAR-10 inference code Code is uploaded on github as

This outputs the result as, You can see that even small CNN, it successfully classifies most […]

Continue reading →

CIFAR-10, CIFAR-100 training with Convolutional Neural Network

  [Update 2017.06.11] Add chainer v2 code Writing your CNN model This is example of small Convolutional Neural Network definition, CNNSmall

  I also made a slightly bigger CNN, called CNNMedium,

  It is nice to know the computational cost for Convolution layer, which is approximated as, $$ H_I \times W_I \times CH_I \times CH_O \times k ^ […]

Continue reading →

CIFAR-10, CIFAR-100 dataset introduction

  Source code is uploaded on github. CIFAR-10 and CIFAR-100 are the small image datasets with its classification labeled. It is widely used for easy image classification task/benchmark in research community. Official page: CIFAR-10 and CIFAR-100 datasets In Chainer, CIFAR-10 and CIFAR-100 dataset can be obtained with build-in function. Setup code: 

  CIFAR-10 chainer.datasets.get_cifar10 […]

Continue reading →

Understanding convolutional layer

Source code is uploaded on github.The sample image is obtained from PEXELS. What is the difference between convolutional layer and linear layer? What kind of intuition is in behind of using convolutional layer in deep neural network? This hands on shows some effects by convolutional layer to provide some intution about what convolutional layer do. […]

Continue reading →