This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from chainer import reporter | |
from chainer.training import util | |
class EarlyStoppingTrigger(object): | |
"""Early stopping trigger | |
It observes the value specified by `key`, and invoke a trigger only when | |
observing value satisfies the `stop_condition`. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import chainer | |
from chainer.datasets import TupleDataset | |
train, test = chainer.datasets.get_mnist() | |
# 1. Extract data easily without explicitly call concat_examples | |
imgs, labels = train.ix[:, :] | |
#imgs, labels = train.ix[:] # same |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import argparse | |
import chainer | |
import chainer.functions as F | |
import chainer.links as L | |
from chainer import training | |
from chainer.optimizers import MomentumSGD, Adam | |
from chainer.training import extensions, Trainer | |
from chainer import serializers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import argparse | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import chainer | |
import chainer.functions as F | |
import chainer.links as L |