Giter VIP home page Giter VIP logo

blur-training_cifar10's Introduction

Blur-Training_Cifar10

Preparation

If you want to run on GPU, you need to check your cuda's version and install pytorch like below.

$ conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

(Check pytorh homepage for more information.)
Then install Python Packages

$ pip install -r requirements.txt

OR pull and run docker image (e.g. blur-training:1.0) I made for this experiments.

Architecture

AlexNet-Cifar10
This AlexNet has different kernel-size and dense-size due to the image size of Cifar10. This AlexNet is the same structure with this site (in Japanese).

Usage: ./training/main.py

General usage example:

$ cd ./training
$ python main.py --mode [TRAINING MODE] -n [EXPERIMENT NAME]

For main.py, you need to use --exp-name or -n option to define your experiment's name. Then the experiment's name is used for managing results under logs/ directory.
You can choose the training mode from {normal,blur-all,blur-half-epochs,blur-step,blur-half-data} by using --mode [TRAINING MODE] option.

  • normal
    This mode trains Normal alexnetCifar10.
    usage example:
$ python main.py --mode normal -e 60 -n normal_60e
  • blur-all
    This mode blurs ALL images in the training mode.
    usage exmaple:
$ python main.py --mode blur-all -s 1 -n blur-all_s1
  • blur-half-epochs
    This mode blurs first half epochs (e.g. first 30 epochs in 60 entire epochs) in the training. usage example:
$ python main.py --mode blur-half-epochs -s 1 -n blur-half-epochs_s1
  • blur-half-data
    This mode blurs half training data. usage example:
$ python main.py --mode blur-half-data -s 1 -n blur-half-data_s1
  • blur-step
    This mode blurs images step by step (e.g. every 10 epochs).
    usage example:
$ python main.py --mode blur-step -n blur-step
  • --blur-val
    This option blurs validation data as well. usage example:
$ python main.py --mode blur-half-epochs -s 1 --blur-val -n blur-half-epochs_blur-val_s1
  • --resume [PATH TO SAVED MODEL]
    This option trains Normal alexnetCifar10 from your saved model.
    usage example:
python main.py -e 90 --mode normal --resume ../logs/models/blur-half-epochs_s1/model_060.pth.tar -n blur-half-epochs_s1_from60e

logs/

logs/ directory will automaticaly be created when you run one of training scripts.
logs/ directory contains outputs/, models/, and tb/ directories.

  • logs/outputs/ : records "stdout" and "stderr" from the training scripts.
  • logs/models/ : records model parameters in the form of pytorch state (default: every 10 epochs).
  • logs/tb/ : records tensorboard outputs. (acc/train, acc/val, loss/train, loss/val)

data/: Cifar10

data/ directory will automaticaly be created when you run one of training scripts.

notebook/

Demonstrations and examples of Gaussian Blur.

citation

Training scripts and functions are strongly relied on pytorch tutorial and pytorch imagenet trainning example.

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.