Code Monkey home page Code Monkey logo

chainer-cifar10's Introduction

Train various models on CIFAR10 with Chainer

Requirements

  • Python 3.5.1+ (not tested with Python2)
  • pip packages:
    • chainer>=3.1.0
    • chainercv>=0.8.0
    • numpy>=1.10.1
    • matplotlib>=2.0.0
    • scikit-image>=0.13.1
    • opencv-python>=3.3.0
    • tabulate>=0.8.2

Quick Start

MPLBACKEND=Agg python train.py

With full arguments:

MPLBACKEND=Agg python train.py \
--model_file models/wide_resnet.py \
--model_name WideResNet \
--batchsize 128 \
--training_epoch 500 \
--initial_lr 0.05 \
--lr_decay_rate 0.5 \
--lr_decay_epoch 70 \
--weight_decay 0.0005 \
--random_angle 15.0 \
--pca_sigma 25.5 \
--expand_ratio 1.2 \
--crop_size 28 28 \
--seed 0 \
--gpus 0 

About data augmentation

It performs various data augmentation using ChainerCV. Provided operations are:

  • Random rotating (using OpenCV or scikit-image)
  • Random lighting
  • Random LR-flipping
  • Random zomming (a.k.a. expansion)
  • Random cropping

See the details at transform function in train.py.

Exprimental Results

model_name val/main/accuracy epoch batchsize crop_size expand_ratio pca_sigma random_angle weight_decay initial_lr lr_decay_rate lr_decay_epoch
LeNet5 0.860166 500 128 [28, 28] 1.2 25.5 15 0.0005 0.01 0.5 50
NIN 0.879351 500 128 [28, 28] 1.2 25.5 15 0.0005 0.01 0.5 100
VGG 0.934237 500 128 [28, 28] 1.2 25.5 15 0.0005 0.05 0.5 50
ResNet50 0.950455 500 128 [28, 28] 1.2 25.5 15 0.0005 0.05 0.5 50
DenseNet 0.944818 500 128 [28, 28] 1.2 25.5 15 0.0005 0.05 0.5 50
WideResNet 0.962322 500 128 [28, 28] 1.2 25.5 15 0.0005 0.05 0.5 70

chainer-cifar10's People

Contributors

mitmul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chainer-cifar10's Issues

The numbers of channels of ResNet

In the original paper, the model has 2n+1 layers of 16 filters, 2n layers of 32 filters and 2n layers of 64 filters.
However, your model seems to have 1 layers of 16 filters, 2n layers of 32 filters and 4n layers of 64 filters.
Perhaps do I misunderstand?

Small bug in accuracy computation

In both train() and validate(), the loss and accuracy on a minibatch are multiplied by args.batchsize instead of the true size of the minibatch. When the batchsize does not evenly divide the size of the dataset, the last batch is smaller than batchsize. To fix this, replace the "* args.batchsize" by "*y_batch.size".

A minor typo in `dataset.py`

There is a typo in line 83 where the label array is cast into int32 type then stored in training_labell. Fortunately, the typo doesn't affect the outcome of the script though.

Another thing: I suggest using numpy.ndarray.astype method for casting types instead of redefining the array, as the former is a little more optimized than the latter.

About output size

In original paper the output map size are 32,16,8 respectively;However in your code it seems that they are 64,32,16. Did I miss anything?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.