Jaehyek Choi Embedded/Firmware Engineer

Deep Learning summary from http://hunkim.github.io/ml/ (1)

2017-01-15
Jaehyek

Simplified Hypothesis and Cost

001

Gradient descent algorithm

  • Minimize cost function
  • Gradient descent is used many minimization problems
  • For a given cost function, cost (W, b), it will find W, b to minimize cost
  • It can be applied to more general function: cost (w1, w2, …)

How to work

  • Formal definition

002 003 004 005

Hypothesis with Matrix

006

Logistic (regression) classification

Logistic Hypothesis

007

New cost function for logistic

008 009

sample code

h = tf.matmul(W, X)
hypothesis = tf.div(1., 1. + tf.exp(-h))

cost = -tf.reduce_mean(Y * tf.log(hypothesis) + (1 - Y) * tf.log(1 - hypothesis))

a = tf.Variable(0.1)  # learning rate, alpha
optimizer = tf.train.GradientDescentOptimizer(a)
train = optimizer.minimize(cost)  # goal is minimize cost

Multinomial classification and Where is sigmoid?

010

SOFTMAX

011

Cross-entropy cost function

012 013 014 015

Data (X) preprocessing for gradient descent

016

standardization

017

  • X_std[:,0] = (X[:,0] - X[:,0].mean()) / X[:,0].std()

Training, validation and test sets

018

MINIST Dataset

019

  • train-images-idx3-ubyte.gz : training set images (9912422 bytes)
  • train-labels-idx1-ubyte.gz : training set lables (18881 bytes)

  • t10k-images-idx3-ubyte.gz : test set images (1648877 bytes)
  • t10k-labels-idx1-ubyte.gz : test set lables ( 4542 bytes)

  • http://yann.lecun.com/exdb/mnist/

Similar Posts

Comments