Coder Social home page Coder Social logo

chainer-cifar's Introduction

Implementation of CIFAR-10 dataset classification using Chainer

Requirements

How to use

Download dataset

$ python src/download.py

Convert dataset

$ python src/dataset.py

This command makes some dataset files:

  • Image dataset files
    • dataset/image.pkl: Only mean value is subtracted
    • dataset/image_zca.pkl: Applied ZCA whitening
    • dataset/image_norm_aca.pkl: Applied Contrast normalization and ZCA whitening
  • Label file
    • dataset/label.pkl

Train

Example:

$ python src/train.py -g 0 -m vgg -b 128 -p vgg --optimizer adam --iter 300 --lr_decay_iter 100

While training the following files are saved.

  • model parameter file <prefix\>.model
  • loss and error log file <prefix\>_log.csv
  • loss curve image <prefix>_loss.png
  • error curve image <prefix>_error.png

Options:

  • -g (--gpu) <int>: Optional
    GPU device ID. Negative value indicates CPU (default: -1)
  • -m (--model) <model name>: Optional
    Model name that is one of the following (default: vgg)
    • cnn: Simple CNN
    • cnnbn: Simple CNN with Batch Normalization
    • vgg: VGG like model
    • residual: Residual Network
  • -b (--batch_size) <int>: Optional
    Mini batch size (default: 100)
  • -d (--dataset) <file path>: Optional
    File path of image dataset file (default: dataset/image.pkl)
  • -l (--label) <file path>: Optional
    File path of label file (default: dataset/label.pkl)
  • -p (--prefix) <str>: Optional
    Prefix of saved model file. (default: <model name>_<optimizer name>)
  • --iter <int>: Optional
    Training iteration (default: 300)
  • --save_iter <int>: Optional
    Iteration interval to save model parameter file. 0 indicates model paramete is note saved at fixed intervals. Note that the best accuracy model is always saved even if this parameter is 0. (default: 0)
  • --optimizer <str>: Optional
    Optimizer name (sgd or adam, default: sgd)
  • --lr <float>: Optional
    Initial learning rate for SGD (default: 0.01)
  • --alpha <float>: Optional
    Initial alpha for Adam (default: 0.001)
  • --lr_decay_iter <int>: Optional
    Iteration interval to decay learning rate. Learning rate is decay to 1/10 at this intervals. (default: 100)
  • --weight_decay <float>: Optional
    Weight decay (default: 0.0001)
  • --res_depth <int>: Optional
    Depth of Residual Network. Total number of residual blodks is res_depth * 3 and total number of layers is res_depth * 6 + 2 (default: 18)
  • --skip_depth: Optional
    Use stochastic depth in Residual Network if set.
  • --seed <int>: Optional
    Random seed (default: 1)

License

MIT License

chainer-cifar's People

Contributors

dsanno avatar

Watchers

 avatar  avatar

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.