[PYTHON] [Introduction to machine learning] Until you run the sample code with chainer

0. Prerequisites

I use pyenv to manage the python version. Please refer to here for pyenv. The version of python used in the text is as follows.

python --version
>> Python 2.7.9 :: Anaconda 2.1.0 (x86_64)

1. Target person

2. Install chainer

Installation is easy. (For details, see chainer official repository) Type the following command in the terminal.

pip install chainer

(By the way, please refer to here to prepare the python environment.)

When performing image processing, high-speed calculation is enabled by using GPU (Graphics Processing Unit). (For more information on machine learning and GPU, see here) To use the GPU, install CUDA (it doesn't matter if you don't install it).

pip install chainer-cuda-deps

To get the sample code working, [Official Repository] Please git clone from (https://github.com/pfnet/chainer).

3. Try running the sample code

[Official repository] above Download the sample code from (https://github.com/pfnet/chainer). There is sample code using the MNIST dataset in the chainer / examples / mnist directory. The MNIST dataset is a dataset containing 70,000 handwritten numbers from 0 to 9.

python train_mnist.py

If you type the above command in the corresponding directory, the sample code will run.

If you want to see the result of the sample code quickly

n_epoch = 20

It is recommended to reduce the above learning_loop.

4. Bonus: Chainer commentary site summary

Recommended Posts

[Introduction to machine learning] Until you run the sample code with chainer
[Python] Easy introduction to machine learning with python (SVM)
Until you install Caffe and run the sample
Until you run the changefinder sample in python
Take the free "Introduction to Python for Machine Learning" online until 4/27 application
Introduction to machine learning
Try to write code from 1 using the machine learning framework chainer (mnist edition)
Python learning notes for machine learning with Chainer Chapters 11 and 12 Introduction to Pandas Matplotlib
Until you install Gauge and run the official sample
An introduction to machine learning
Super introduction to machine learning
Until you create a machine learning environment with Python on Windows 7 and run it
Introduction to Machine Learning with scikit-learn-From data acquisition to parameter optimization
Machine learning to learn with Nogizaka46 and Keyakizaka46 Part 1 Introduction
Introduction to machine learning Note writing
Introduction to Machine Learning Library SHOGUN
Until you run python with apache
Before the introduction to machine learning. ~ Technology required for machine learning other than machine learning ~
Python learning memo for machine learning by Chainer Chapter 10 Introduction to Cupy
[Introduction to StyleGAN] Unique learning of anime with your own machine ♬
Introduction to Deep Learning (2) --Try your own nonlinear regression with Chainer-
Python learning memo for machine learning by Chainer Chapter 9 Introduction to scikit-learn
Machine learning model management to avoid quarreling with the business side
Until you build the environment with ABCI and run MaskTrack RCNN
I tried to make Othello AI with tensorflow without understanding the theory of machine learning ~ Introduction ~
Introduction to Machine Learning: How Models Work
Record the steps to understand machine learning
An introduction to OpenCV for machine learning
Introduction to ClearML-Easy to manage machine learning experiments-
An introduction to Python for machine learning
What to do if the Chainer (Windows) sample mnist terminates with WinError 183.
I tried to visualize the model with the low-code machine learning library "PyCaret"
Memorandum of means when you want to make machine learning with 50 images
Python learning memo for machine learning by Chainer until the end of Chapter 2
Introduction to Deep Learning for the first time (Chainer) Japanese character recognition Chapter 2 [Model generation by machine learning]
[Super Introduction to Machine Learning] Learn Pytorch tutorials
An introduction to machine learning for bot developers
[Introduction to StyleGAN2] Independent learning with 10 anime faces ♬
Until you use the Kaggle API with Colab
[Super Introduction to Machine Learning] Learn Pytorch tutorials
Introduction to Python with Atom (on the way)
[For beginners] Introduction to vectorization in machine learning
Machine Learning sample
Introducing the book "Creating a profitable AI with Python" that allows you to learn machine learning in the shortest course
Run the output code with tkinter, saying "A, pretending to be B" in python
The first step of machine learning ~ For those who want to implement with python ~
Until you commit the source code to the public branch of AGL (Automotive Grade Linux)
Until you commit the source code to the public branch of AGL (Automotive Grade Linux) 2
Introduction to machine learning ~ Let's show the table of K-nearest neighbor method ~ (+ error handling)
Until you can install blender and run it with python for the time being
I tried to learn the sin function with chainer
I tried to move machine learning (ObjectDetection) with TouchDesigner
A quick introduction to the neural machine translation library
Run a machine learning pipeline with Cloud Dataflow (Python)
[Introduction to Python] How to iterate with the range function?
Machine learning python code summary (updated from time to time)
Settings when you want to run python-mecab with travis
Try to predict forex (FX) with non-deep machine learning
Predict the gender of Twitter users with machine learning
Site summary to learn machine learning with English video
Summary of the basic flow of machine learning with Python