2016年10月8日 星期六

[Udacity-Deep Learning] Quiz : Softmax

開始上 Udacity 由Google所開設的Deep Learning課程

遇到了第一個Quiz問題

想吐槽的點是,Softmax 在Udacity的影片裡面根本沒提到Softmax的演算法

就直接叫我們進行python的程式撰寫

搞了一個多小時,撞了牆之後才發現原來我根本搞錯啦 XDDDD

Wiki 中,Softmax的條目說,Softmax演算法應用於機率與機器學習等不同的領域中

"In mathematics, in particular probability theory and related fields, the softmax function, or normalized exponential,[1]:198 is a generalization of the logistic function that "squashes" a K-dimensional vector  of arbitrary real values to a K-dimensional vector  of real values in the range (0, 1) that add up to 1. The function is given by

    for j = 1, …, K."

基本上,演算法就是上面的那個運算式進行撰寫

softmax : np.exp(x) / np.sum( np.exp(x), axis = 0 )



附上Udacity論壇中有人跟我有一樣的疑惑的問題

Why do we use exponentials in Softmax ? 

關於 exp() 運算複雜的問題,有相關的stackoverflow上的問題

Why use softmax as opposed to standard normalization?

沒有留言:

張貼留言

/* 載入prettify的autoloader */ /* 載入JQuery */