Iterator module introduction

  • SerialIterator
  • MultiProcessIterator

In [1]:
# Initial setup following http://docs.chainer.org/en/stable/tutorial/basic.html
import numpy as np
import chainer
from chainer import cuda, Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from chainer.training import extensions
import chainer.dataset
import chainer.datasets
import chainer.training.updaters

SerialIterator

This iterator is basic function.

Implement custom updater by overriding StandardUpdater

Most of the time, you can override __init__ and update_core function to customize how to calculate the loss and how to update the models. You can also refer official chainer DCGAN example for how to implement customized updater.


In [ ]:

MultiProcessParallelUpdater

This can be used to train the model with multiple GPUs. Note that you need to install NCCL before installing chainer and cupy


In [ ]: