Showing posts with label Tensorflow. Show all posts
Showing posts with label Tensorflow. Show all posts

Tuesday, January 9, 2018

Edward modeling to an artificial data

Overview

On the article below, I switched method on Edward model from variational method to Hamiltonian Monte Carlo.
As an another example, I'll try same thing to the model of the following article.
In a nutshell, I'll make model for an artificial data and get sample by Hamiltonian Monte Carlo.

Hamiltonian Monte Carlo on TensorFlow and Edward

Overview

On this article, I tried Hamiltonian Monte Carlo algorithm to the simple data by TensorFlow and Edward.
Edward lets us use variational inference, Gibbs sampling and Monte Carlo method. And by relatively small changes, we can switch the methods. So I'll try simple HML model here.
About Hamiltonian Monte Carlo itself, I'll write another article for it.

Monday, January 8, 2018

How to convert a Keras model to a TensorFlow Estimator

Overview

TensorFlow has the the function of converting Keras model to TensorFlow Estimator. On this article, I checked how to use it.
About the TensorFlow Estimator. Please read the article below and official pages.


Anyway, Keras lets us write neural network model relatively easily. But sometimes we need a model following TensorFlow. On this kind of cases, we write the model by Keras at first and after that can convert it to TnsorFlow's one.

Sunday, January 7, 2018

Simple case of tf.keras

Overview

On this article, I rewrote the Keras code by tf.keras. From TensorFlow, we can use Keras by tf.keras. But I had never used this. So I checked and it was very simple and easy.

Wednesday, December 27, 2017

Time series analysis on TensorFlow and Edward: local level model:P.S. 1

Overview

On the article below, I tried to analyze time series data with local level model. On Stan, I could do it before without problem. But on Edward and TensorFlow, I have been struggling.

Time series analysis on TensorFlow and Edward: local level model

Deep learning and Machine learning methods blog


From the situation above, although it doesn’t work well yet, I got some progress.

Monday, December 25, 2017

Time series analysis on TensorFlow and Edward: local level model

Overview

To review the time series analysis from the basic points, I tried to do state space modeling with TensorFlow and Edward. And I’m at a loss.
The main purposes are these two.

  • review the time series analysis from the basic points
  • try to check how to do that on Edward and TensorFlow


Monday, December 18, 2017

Classification by deep neural network using tf.estimator of TensorFlow

Overview

On the article below, I checked how to write deep neural network by tf.estimator. But it was regression case.


tf.estimator of TensorFlow lets us concisely write deep neural network

On this article, I'll re-write the simple deep neural network model to iris data by tf.estimator. From official page, TensorFlow's high-level machine learning API (tf.estimator) makes it easy to configure, train, and evaluate a variety of machine learning models. By comparing with the original code, I'll check how much it becomes concise and how to use tf.estimator.
Here, just in case, I’ll check the classification case. This is totally same as the official page’s tutorial and actually, the difference between regression and classification about the aspect of code is quite few. But classification and regression are one of the most basic tasks on machine learning and data science. So I’ll do it by myself.

Sunday, December 17, 2017

tf.estimator of TensorFlow lets us concisely write deep neural network

Overview


On this article, I’ll re-write the simple deep neural network model to iris data by tf.estimator. From official page,
TensorFlow’s high-level machine learning API (tf.estimator) makes it easy to configure, train, and evaluate a variety of machine learning models.
By comparing with the original code, I’ll check how much it becomes concise and how to use tf.estimator.

Saturday, December 9, 2017

Simple example of how to use TensorBoard

Overview


On this article, through the simple regression, I’ll show how to observe the parameter’s behavior on TensorBoard.

TensorBoard is cool visualizing tool and by using it, our debug to model can be easier.

Thursday, December 7, 2017

How to use TensorBoard through arithmetic calculation on TensorFlow

Overview

Through basic arithmetic operations, let’s check how those are expressed on TensorBoard.

It has two main points.
One, check the main calculation function on TensorFlow.
Two, check how it is expressed on TensorBoard.

TensorFlow deals with Tensor, leading us to use TensorFlow’s methods for mathematical operations. Simply, here, I’ll use some of them. And, TensorBoard is the tool to check the graph and other information graphically. As a simple check, I’ll show how those operations are expressed visually on that.


Friday, December 1, 2017

Edward modeling to artificial data with random effects

Overview

By Edward, I’ll try to make the model with random effect.
There are some ways to fulfill that. On this article, I’ll follow the style that the Edward tutorial takes.

Tuesday, November 14, 2017

Simple Baysian Neural Network with Edward

Overview

Edward can enable us to convert TensorFlow code to Baysian one. I’m not used to Edward. So for the training, I’m tackling with converting some TensorFlow code to Edward one. On this article, I tried to convert simple neural network model to Baysian neural network one.

The purpose of this article is to convert the TensorFlow code I posted before to Baysian one by Edward.

Baysian neural network model

By Edward, we can relatively easily convert the model using TensorFlow to probabilistic one.
The regression model for iris data is from the article below.

Simple regression model by TensorFlow

Neural network is composed of input, hidden and output layers. And the number of hidden layers is optional. So the simplest network architecture has just one hidden layer. On this article, I'll make the simplest neural network for regression by TensorFlow.


In a nutshell, the model is to predict one target value from three features. About the details, please check the article.

Monday, September 25, 2017

Simple tutorial to write deep neural network by TensorFlow

Overview


On this article, I’ll show simple deep neural network(DNN) model for regression by TensorFlow.

TensorFlow is open source library from Google. From the official web site,
TensorFlow™ is an open source software library for numerical computation using data flow graphs.

From wikipedia,
TensorFlow is an open-source software library for machine learning across a range of tasks. It is a system for building and training neural networks to detect and decipher patterns and correlations, analogous to (but not the same as) human learning and reasoning.[3] It is used for both research and production at Google,‍[3]:min 0:15/2:17 [4]:p.2 [3]:0:26/2:17 often replacing its closed-source predecessor, DistBelief.

It lets us make neural network relatively easily. But different from keras, this needs proper knowledge of the things you want to make.
This article is almost simple tutorial to make deep neural network model for regression.

You can know the followings on this article.
  • What is deep neural network?
  • How do we write deep neural network model by TensorFlow

Sunday, September 24, 2017

Simple regression model by TensorFlow

Overview

Neural network is composed of input, hidden and output layers. And the number of hidden layers is optional. So the simplest network architecture has just one hidden layer.

On this article, I’ll make the simplest neural network for regression by TensorFlow.

From the official web site,
TensorFlow™ is an open source software library for numerical computation using data flow graphs.

This makes it easier to make shallow and deep neural network and other machine leaning algorithms. Through the simple trial, we can learn about TensorFlow and the system of neural network.

About the Tensorflow itself, please check the article below.

Friday, September 15, 2017

How to write kNN by TensorFlow

Overview

How do we write machine learning algorithms with TensorFlow?
I usually use TensorFlow only when I write neural networks. But actually TensorFlow is not only for that. It also can be used to write other machine leaning algorithms.
On this article, I tried to roughly write kNN algorithm by TensorFlow.



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?

Friday, June 23, 2017

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.

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.