Thursday, June 29, 2017

Re-try CNN + KNN model

Overview

When I tried CNN + KNN model before, the training epoch was not enough(50) to check the characteristics. This time I trained 200 epoch on the CNN phase.

Wednesday, June 28, 2017

Simple guide to Neural Network

What is Neural network?

Neural network is an algorithm which make input go through at least one hidden and output layers to output.
Graphically it is like below.


Tuesday, June 27, 2017

CNN + KNN model accuracy

Overview

On the contest site like Kaggle, we can see many trials and good scores by the combination of some methods.
For example, you can get scores by logistic regression and lasso regression. You can make xgboost model by using those scores.
This time, about cifar-10, I make CNN model. And by using the score, I check KNN scores.

Sunday, June 25, 2017

The pragmatic procedure of making CNN model

Overview


On the image classification modeling, you need to understand how good your model is, meaning not absolute accuracy itself but relative meaning of the accuracy.

This is the example. Your first trial model's validation accuracy is 0.6. How do you think about it?
Without knowing the unique label number, ratio, and the data's difficulty, only answer you can return is "I don't know".
To evaluate the model, not only the absolute accuracy but also the base score to compare with are necessary.

If the modeling trial and error don't take much time, you can feel the scale of goodness and accuracy by many trial samples. But usually image classification model takes much time to make themselves.
How do we do the shortcut?

How to write diverged type neural network by keras

How to write Diverged neural network

Overview


Simple style neural network as below is easy to write by deep learning frame work. 


This time, I make diverged neural network whose route to output is diverged and merged. The image of this is like below.



The purpose of this article is following two points.
  • see how to write diverged type neural network
  • see how accurate and good this type of model is
I used keras to write. Although it is bit annoying to write this kind of neural network compared with simple type, keras makes diverged type of model in relatively easy manner.
About the model's characteristics and accuracy, it’s difficult to judge, because there is no simple model which is relevant to the diverged model. So, we can just check roughly.

Friday, June 23, 2017

Sigmoid function

sigmoid function

Sigmoid function is frequently used in machine learning, because it can approximates discontinuous function like step function.
This function is very simple as you can see.

In the code, you can write like this.
import numpy as np

def sig(x):
    return 1 / (1 + np.exp(-x))
And by plotting.
import matplotlib.pyplot as plt

x = list(range(-100, 100))
y = [sig(i) for i in x]
plt.plot(x, y)
plt.show()



On this plot, the inclination looks too strong.
By focusing on small range, we check this.
x = list(range(-10, 10))
y = [sig(i) for i in x]
plt.plot(x, y)
plt.show()


By this, we can see how it changes.
Sigmoid function has following characteristics.
  • When the input is equal to 0, the output is 1/2.
  • This function is monotonically increasing.
  • This function is point symmetry at (0, 1/2)

Googles's Tensorflow Object Detection API trial

Try Google’s TensorFlow Object Detection API

Overview

Google sent to the world awesome object detector.
When I tried object detection before by myself, I strongly felt it was hard job and even small trial took much time.
Not to be late to the growing technology about image detection, I tried object detection tutorial today.

Thursday, June 22, 2017

Method for efficient neural network

Overview

Usually, neural network’s training takes much time and doesn’t go well. There are some ways to make that efficiently go.
Here, I list up those and summarize.
By using those method, the training go well and good model can be made.

Wednesday, June 21, 2017

Plot some graph at once by matplotlib

How to do subplot

Overview

When we make machine learning model and check how accurate the predictions are, we frequently plot those.
Plotting some graphs at the same time is very useful to compare outcomes. By matplotlib, those can be done.

Saturday, June 17, 2017

How to use Inception v3

Low cost image classification by CNN, convolutional neural network

Overview

These days, CNN(convolutional neural network) is almost regarded as the best answer to classify images.
But it has many rules.
  • it needs huge amount of images
  • it takes much time to train
  • it needs slow and gradual steps to find good network model to attein the goal
  • it needs high spec environment to do try-and-error
Of course, there are free data sets and kinda sample network which works easily in short time. But at the case you practically make model to solve some practical problem personaly or oficilally, those restrictions can face with you.
The combination of Inception v3 model and fine tune can solve the point.

Friday, June 16, 2017

Basic classification example by logistic regression

Basic classification example

Overview

I make classification model of free wine data, following how to deal with it step by step.

Convolutional neural network scale experiment by keras

Overview


It is not easy to understand about convolutional neural network how the goodness changes when the nodes each layer has, layer’s number and other factors change.
For practical use of convolutional neural network, I experimented some types of convolutional neural network.

Tuesday, June 13, 2017

Breakout by tensorflow model

Overview

I made a Tensorflow model of breakout by the data which is from my playing.
The purpose of this is to visually observe how outcome of the prediction works. So this time ‘theoretical accuracy’ should be left behind.
I just made simple and easy model without thinking about details and tried to make the model play breakout like the following image.


The one I used as breakout is from address.
breakout


Monday, June 12, 2017

Simple guide for Tensorflow

Overview


This article is to roughly understand Tensorflow and make easy model.
These days if you are machine-oriented person, you can't pass even a day without hearing the name of Tensorflow. This is very useful tool but not so easily approachable.
Let't check what Tensorflow is and how you can use it.



Wednesday, June 7, 2017

Convolutional neural network by keras

Make convolutional neural network model for mnist in keras

Overview

Convolutional neural network is one of the best solutions about image classification. In keras, it is relatively easy to make model.

Tuesday, June 6, 2017

Simple keras trial

Simple keras trial

Overview

By making simple newral network, I try to use keras.