UFLDL教程:Exercise:Softmax Regression
Softmax分類函數(shù)的Python實(shí)現(xiàn)
Deep Learning and Unsupervised Feature Learning Tutorial Solutions
邏輯回歸假設(shè)函數(shù)
在線性回歸問(wèn)題中,假設(shè)函數(shù)具有如下形式:
在 logistic 回歸中,我們的訓(xùn)練集由m 個(gè)已標(biāo)記的樣本構(gòu)成:,其中輸入特征。 由于 logistic 回歸是針對(duì)二分類問(wèn)題的,因此類標(biāo)記 。邏輯回歸的假設(shè)函數(shù)的輸出值位于[0, 1]之間,所以,我們需要找到一個(gè)滿足這個(gè)性質(zhì)的假設(shè)函數(shù)。
在邏輯回歸問(wèn)題中,將該函數(shù)的形式轉(zhuǎn)換為如下形式:
其中,函數(shù)g稱為S型函數(shù)(sigmoid function)或者是邏輯函數(shù)(Logistic function)(這兩個(gè)術(shù)語(yǔ)是可以互換的),它具有如下形式:
該函數(shù)圖形如下圖所示:
可以看到,S型函數(shù)的取值位于(0,1)之間,滿足 。那么
邏輯回歸的假設(shè)函數(shù)(hypothesis function) 可以為如下形式:
雖然該算法中有”回歸”二字,但其實(shí)它并不是一種回歸算法,而是一種分類算法。
成本函數(shù)Cost和代價(jià)函數(shù)J
介紹構(gòu)造邏輯回歸問(wèn)題的成本函數(shù)Cost和代價(jià)函數(shù)J。給定了一個(gè)含有m個(gè)樣本的訓(xùn)練樣本集,每個(gè)樣本具有n維特征。x(i)為第i個(gè)樣本的特征向量,y(i)為第i個(gè)樣本的分類標(biāo)簽,回歸問(wèn)題的假設(shè)函數(shù)為hθ(x),那么,如何能夠根據(jù)給定的訓(xùn)練樣本集得到假設(shè)函數(shù)中的參數(shù)向量θ(也就是模型參數(shù))呢?
參考線性回歸分析中的代價(jià)函數(shù)J(θ):
可以構(gòu)造如下的代價(jià)函數(shù)J(θ)
其中成本函數(shù)Cost為(類比線性回歸問(wèn)題構(gòu)造的):
但是,這個(gè)成本函數(shù)Cost是關(guān)于θ的非凸函數(shù),它的圖形如下圖左側(cè)所示,梯度下降法不能保證該函數(shù)收斂到全局最小值,但梯度下降法可以保證凸函數(shù)(如下圖右側(cè)所示)收斂到全局最小解。所以,我們需要尋找另外的代價(jià)函數(shù),使它是凸函數(shù)。
對(duì)于邏輯回歸問(wèn)題,構(gòu)造如下式所示的成本函數(shù):
也就是說(shuō),當(dāng)樣本標(biāo)簽為1時(shí),利用-log(hθ(x))計(jì)算成本函數(shù),該函數(shù)圖像如下圖左側(cè)所示;當(dāng)樣本標(biāo)簽為0時(shí),利用-log(1-hθ(x))計(jì)算成本函數(shù),該函數(shù)圖像如下圖右側(cè)所示。
從圖中可以看出成本函數(shù)的意義:
當(dāng)y=1(即標(biāo)簽為1)時(shí)
假設(shè)函數(shù)的輸出值為1,則成本函數(shù)取值為0(實(shí)現(xiàn)了正確的分類,不需要付出代價(jià))。
假設(shè)函數(shù)的輸出值為0,則成本函數(shù)取值為無(wú)窮大(分類錯(cuò)誤,付出了無(wú)窮大的代價(jià))。
邏輯回歸的極大使然推導(dǎo)
邏輯回歸的理激活函數(shù)是sigmoid函數(shù),可理解成一個(gè)被sigmoid函數(shù)歸一化后的線性回歸。因?yàn)閟igmoid函數(shù)把實(shí)數(shù)映射到了[0,1]區(qū)間。給定有一個(gè)訓(xùn)練數(shù)據(jù),構(gòu)造它的似然函數(shù)(likelihood function)為
一般會(huì)使用最大釋然求解參數(shù),這時(shí)取一個(gè)負(fù)的log對(duì)數(shù)(negative logarithm),得到:
上式被稱為交叉熵(cross entropy) loss函數(shù),因?yàn)槿×艘粋€(gè)負(fù)對(duì)數(shù),之前的最大化就變成了最小化,所以只需求解是交叉熵loss函數(shù)最小的參數(shù)。
對(duì)loss函數(shù)求導(dǎo)得到
到現(xiàn)在為止,我們已經(jīng)得到了loss函數(shù)以及關(guān)于參數(shù)的偏導(dǎo)數(shù),只需要通過(guò)梯度下降就可以得到參數(shù)的解。
簡(jiǎn)化成本函數(shù)Cost和代價(jià)函數(shù)J
下式給出了邏輯回歸問(wèn)題的代價(jià)函數(shù)J(θ)(即考慮了m個(gè)訓(xùn)練樣本)
可以看到,在分類問(wèn)題中,訓(xùn)練樣本的y值永遠(yuǎn)是1或者0,所以可以據(jù)此來(lái)簡(jiǎn)化成本函數(shù)的書寫(即將原來(lái)的分情況討論的兩個(gè)式子合并為一個(gè)式子),簡(jiǎn)化后的成本函數(shù)如下:
從而,邏輯回歸的代價(jià)函數(shù)J(θ)可以寫為:
通過(guò)最小化代價(jià)函數(shù)J(θ)可以得到最優(yōu)的向量參數(shù)。
邏輯回歸問(wèn)題的梯度下降法
相應(yīng)的損失函數(shù)為
優(yōu)化問(wèn)題的關(guān)鍵問(wèn)題是代價(jià)函數(shù)對(duì)待優(yōu)化參數(shù)的梯度和代價(jià)函數(shù)取值的求解。
偏導(dǎo)數(shù)公式和向量化推導(dǎo)
偏導(dǎo)數(shù)的推導(dǎo)過(guò)程
向量化的推導(dǎo)過(guò)程
% Exercise 4 -- Logistic Regressionclear all; close all; clcx = load('ex4x.dat'); y = load('ex4y.dat');[m, n] = size(x);% Add intercept term to x x = [ones(m, 1), x]; % Plot the training data % Use different markers for positives and negatives figure pos = find(y); neg = find(y == 0);%find是找到的一個(gè)向量,其結(jié)果是find函數(shù)括號(hào)值為真時(shí)的值的編號(hào) plot(x(pos, 2), x(pos,3), '+') hold on plot(x(neg, 2), x(neg, 3), 'o') hold on xlabel('Exam 1 score') ylabel('Exam 2 score')% Initialize fitting parameters theta = zeros(n+1, 1);% Define the sigmoid function g = inline('1.0 ./ (1.0 + exp(-z))'); % Newton's method MAX_ITR = 7; J = zeros(MAX_ITR, 1);for i = 1:MAX_ITR% Calculate the hypothesis functionz = x * theta;h = g(z);%轉(zhuǎn)換成logistic函數(shù)% Calculate gradient and hessian.% The formulas below are equivalent to the summation formulas% given in the lecture videos.grad = (1/m).*x' * (h-y);%梯度的矢量表示法H = (1/m).*x' * diag(h) * diag(1-h) * x;%hessian矩陣的矢量表示法% Calculate J (for testing convergence)J(i) =(1/m)*sum(-y.*log(h) - (1-y).*log(1-h));%損失函數(shù)的矢量表示法theta = theta - H\grad;%是這樣子的嗎? end % Display theta theta% Calculate the probability that a student with % Score 20 on exam 1 and score 80 on exam 2 % will not be admitted prob = 1 - g([1, 20, 80]*theta)%畫出分界面 % Plot Newton's method result % Only need 2 points to define a line, so choose two endpoints plot_x = [min(x(:,2))-2, max(x(:,2))+2]; % Calculate the decision boundary line,plot_y的計(jì)算公式見博客下面的評(píng)論。 plot_y = (-1./theta(3)).*(theta(2).*plot_x +theta(1)); plot(plot_x, plot_y) legend('Admitted', 'Not admitted', 'Decision Boundary') hold off% Plot J figure plot(0:MAX_ITR-1, J, 'o--', 'MarkerFaceColor', 'r', 'MarkerSize', 8) xlabel('Iteration'); ylabel('J') % Display J J
Softmax的極大使然推導(dǎo)
在Logistic回歸中,樣本數(shù)據(jù)的值 ,而在softmax回歸中,其中k是類別種數(shù),
比如在手寫識(shí)別中k=10,表示要識(shí)別的10個(gè)數(shù)字。設(shè)
那么
而且有
為了將多項(xiàng)式模型表述成指數(shù)分布族,先引入T(y),它是一個(gè)k-1維的向量,那么
應(yīng)用于一般線性模型,y必然是屬于k個(gè)類中的一種。用表示為真,同樣當(dāng)為假時(shí),有
,那么進(jìn)一步得到聯(lián)合分布的概率密度函數(shù)為
對(duì)比一下,可以得到
由于
那么最終得到
可以得到期望值為
接下來(lái)得到對(duì)數(shù)似然函數(shù)函數(shù)為
其中是一個(gè)k(n+1)的矩陣,代表這k個(gè)類的所有訓(xùn)練參數(shù),每個(gè)類的參數(shù)是一個(gè)n+1維的向量。所以在softmax回歸中將x分類為類別 l 的概率為
跟Logistic回歸一樣,softmax也可以用梯度下降法或者牛頓迭代法求解,對(duì)對(duì)數(shù)似然函數(shù)求偏導(dǎo)數(shù),得到
然后我們可以通過(guò)梯度上升法來(lái)更新參數(shù)
注意這里是第 l 個(gè)類的所有參數(shù),它是一個(gè)向量。
在softmax回歸中直接用上述對(duì)數(shù)似然函數(shù)是不能更新參數(shù)的,因?yàn)樗嬖谌哂嗟膮?shù),通常用牛頓方法中的Hessian矩陣也不可逆,是一個(gè)非凸函數(shù),那么可以通過(guò)添加一個(gè)權(quán)重衰減項(xiàng)來(lái)修改代價(jià)函數(shù),使得代價(jià)函數(shù)是凸函數(shù),并且得到的Hessian矩陣可逆。更多詳情參考如下鏈接。
鏈接:http://deeplearning.stanford.edu/wiki/index.php/Softmax%E5%9B%9E%E5%BD%92
Softmax回歸
在 softmax回歸中,我們解決的是多分類問(wèn)題(相對(duì)于 logistic 回歸解決的二分類問(wèn)題),類標(biāo) y 可以取 k 個(gè)不同的值(而不是 2 個(gè))。因此,對(duì)于訓(xùn)練集 ,我們有 。(注意此處的類別下標(biāo)從 1 開始,而不是 0)。
對(duì)于給定的測(cè)試輸入 x,我們想用假設(shè)函數(shù)針對(duì)每一個(gè)類別j估算出概率值 p(y=j | x)。也就是說(shuō),我們想估計(jì) x 的每一種分類結(jié)果出現(xiàn)的概率。因此,我們的假設(shè)函數(shù)將要輸出一個(gè) k 維的向量(向量元素的和為1)來(lái)表示這 k 個(gè)估計(jì)的概率值。 具體地說(shuō),我們的假設(shè)函數(shù) 形式如下:
其中 是模型的參數(shù)。請(qǐng)注意 這一項(xiàng)對(duì)概率分布進(jìn)行歸一化,使得所有概率之和為 1
代價(jià)函數(shù)
這個(gè)公式是從邏輯回歸的代價(jià)函數(shù)推廣而來(lái)的。
注意在Softmax回歸中將 x 分類為類別 j的概率為:
備注
邏輯回歸的代價(jià)函數(shù)是根據(jù)極大似然估計(jì)推理得來(lái),Softmax的代價(jià)函數(shù)也類似。
在邏輯回歸中我們梯度下降法求解最優(yōu)值,Softmax回歸也是用梯度下降法求解最優(yōu)值,梯度公式如下:
Softmax回歸模型參數(shù)具有“冗余”性
冗余性指的是最優(yōu)解不止一個(gè),有多個(gè)。假設(shè)我們從參數(shù)向量 中減去了向量 ,這時(shí),每一個(gè) 都變成了 。此時(shí)假設(shè)函數(shù)變成了以下的式子:
我們看到,從 中減去 完全不影響假設(shè)函數(shù)的預(yù)測(cè)結(jié)果!這就是Softmax回歸的冗余性。
權(quán)重衰減
針對(duì)上述的冗余性,我們應(yīng)該怎么辦呢?權(quán)重衰減可以解決這個(gè)問(wèn)題。
我們通過(guò)添加一個(gè)權(quán)重衰減項(xiàng) 來(lái)修改代價(jià)函數(shù),這個(gè)衰減項(xiàng)會(huì)懲罰過(guò)大的參數(shù)值,現(xiàn)在我們的代價(jià)函數(shù)變?yōu)?#xff1a;
有了這個(gè)權(quán)重衰減項(xiàng)以后 ,代價(jià)函數(shù)就變成了嚴(yán)格的凸函數(shù),這樣就可以保證得到唯一的解了。
為了使用優(yōu)化算法,我們需要求得這個(gè)新函數(shù) 的導(dǎo)數(shù),如下:
通過(guò)最小化 ,我們就能實(shí)現(xiàn)一個(gè)可用的 softmax 回歸模型。
Softmax回歸與Logistic回歸的關(guān)系
當(dāng)類別數(shù) k = 2 時(shí),softmax 回歸退化為 logistic 回歸。這表明 softmax 回歸是 logistic 回歸的一般形式。具體地說(shuō),當(dāng) k = 2 時(shí),softmax 回歸的假設(shè)函數(shù)為
利用softmax回歸參數(shù)冗余的特點(diǎn),我們令 ,并且從兩個(gè)參數(shù)向量中都減去向量 ,得到:
因此,用來(lái)表示,我們就會(huì)發(fā)現(xiàn) softmax 回歸器預(yù)測(cè)其中一個(gè)類別的概率為 ,另一個(gè)類別概率的為 ,這與 logistic回歸是一致的。
Softmax 回歸 vs. k 個(gè)二元分類器
如果你在開發(fā)一個(gè)音樂(lè)分類的應(yīng)用,需要對(duì)k種類型的音樂(lè)進(jìn)行識(shí)別,那么是選擇使用 softmax 分類器呢,還是使用 logistic 回歸算法建立 k 個(gè)獨(dú)立的二元分類器呢?
這一選擇取決于你的類別之間是否互斥,例如,如果你有四個(gè)類別的音樂(lè),分別為:古典音樂(lè)、鄉(xiāng)村音樂(lè)、搖滾樂(lè)和爵士樂(lè),那么你可以假設(shè)每個(gè)訓(xùn)練樣本只會(huì)被打上一個(gè)標(biāo)簽(即:一首歌只能屬于這四種音樂(lè)類型的其中一種),此時(shí)你應(yīng)該使用類別數(shù) k = 4 的softmax回歸。(如果在你的數(shù)據(jù)集中,有的歌曲不屬于以上四類的其中任何一類,那么你可以添加一個(gè)“其他類”,并將類別數(shù) k 設(shè)為5。)
如果你的四個(gè)類別如下:人聲音樂(lè)、舞曲、影視原聲、流行歌曲,那么這些類別之間并不是互斥的。例如:一首歌曲可以來(lái)源于影視原聲,同時(shí)也包含人聲 。這種情況下,使用4個(gè)二分類的 logistic 回歸分類器更為合適。這樣,對(duì)于每個(gè)新的音樂(lè)作品 ,我們的算法可以分別判斷它是否屬于各個(gè)類別。
現(xiàn)在我們來(lái)看一個(gè)計(jì)算視覺(jué)領(lǐng)域的例子,你的任務(wù)是將圖像分到三個(gè)不同類別中。
(i) 假設(shè)這三個(gè)類別分別是:室內(nèi)場(chǎng)景、戶外城區(qū)場(chǎng)景、戶外荒野場(chǎng)景。你會(huì)使用sofmax回歸還是 3個(gè)logistic 回歸分類器呢?
(ii) 現(xiàn)在假設(shè)這三個(gè)類別分別是室內(nèi)場(chǎng)景、黑白圖片、包含人物的圖片,你又會(huì)選擇 softmax 回歸還是多個(gè) logistic 回歸分類器呢?
在第一個(gè)例子中,三個(gè)類別是互斥的,因此更適于選擇softmax回歸分類器 。
而在第二個(gè)例子中,建立三個(gè)獨(dú)立的 logistic回歸分類器更加合適。
實(shí)驗(yàn)步驟
1.初始化參數(shù),加載訓(xùn)練數(shù)據(jù)集。注意:MNIST手寫數(shù)字?jǐn)?shù)據(jù)集所有圖片的每個(gè)像素灰度值都已經(jīng)被歸一化到了[0,1]之間,所以將來(lái)如果是用自己的訓(xùn)練樣本,不要忘記歸一化像素值。
2.矢量化編程實(shí)現(xiàn)softmax回歸的代價(jià)函數(shù)及其梯度,即softmaxCost.m文件。
3.利用computeNumericalGradient函數(shù)檢查上一步中的梯度計(jì)算是否正確,該函數(shù)見Deep Learning一:Sparse Autoencoder練習(xí)(斯坦福大學(xué)UFLDL深度學(xué)習(xí)教程)。
4.用用L-BFGS算法訓(xùn)練softmax回歸模型,得到模型softmaxModel,見softmaxTrain.m中的softmaxTrain函數(shù)
5.加載測(cè)試數(shù)據(jù)集,用上一步訓(xùn)練得到模型softmaxModel來(lái)對(duì)測(cè)試數(shù)據(jù)進(jìn)行分類,得到分類結(jié)果(見softmaxPredict.m),然后計(jì)算正確率。
softmaxExercise.m
%% CS294A/CS294W Softmax Exercise % Instructions % ------------ % % This file contains code that helps you get started on the % softmax exercise. You will need to write the softmax cost function % in softmaxCost.m and the softmax prediction function in softmaxPred.m. % For this exercise, you will not need to change any code in this file, % or any other files other than those mentioned above. % (However, you may be required to do so in later exercises)%%====================================================================== %% STEP 0: Initialise constants and parameters % % Here we define and initialise some constants which allow your code % to be used more generally on any arbitrary input. % We also initialise some parameters used for tuning the model.inputSize = 28 * 28; % Size of input vector (MNIST images are 28x28)特征維數(shù) numClasses = 10; % Number of classes (MNIST images fall into 10 classes)樣本類別數(shù)lambda = 1e-4; % Weight decay parameter衰減項(xiàng)權(quán)重%%====================================================================== %% STEP 1: Load data % % In this section, we load the input and output data. % For softmax regression on MNIST pixels, % the input data is the images, and % the output data is the labels. %% Change the filenames if you've saved the files under different names % On some platforms, the files might be saved as % train-images.idx3-ubyte / train-labels.idx1-ubyte addpath mnist/ images = loadMNISTImages('mnist/train-images.idx3-ubyte');%每一列為MNIST數(shù)據(jù)集中的一個(gè)樣本的特征向量 labels = loadMNISTLabels('mnist/train-labels.idx1-ubyte');% 每個(gè)樣本的類標(biāo) labels(labels==0) = 10; % Remap 0 to 10inputData = images; clear images % For debugging purposes, you may wish to reduce the size of the input data % in order to speed up gradient checking. % Here, we create synthetic dataset using random data for testingDEBUG = true; % Set DEBUG to true when debugging. if DEBUGinputSize = 8;inputData = randn(8, 100);labels = randi(10, 100, 1); end%它的維數(shù)是k*n,k是類別數(shù)numClasses,n是輸入樣本的特征維數(shù)inputSize % Randomly initialise theta theta = 0.005 * randn(numClasses * inputSize, 1); %輸入的是一個(gè)列向量%%====================================================================== %% STEP 2: Implement softmaxCost % % Implement softmaxCost in softmaxCost.m. [cost, grad] = softmaxCost(theta, numClasses, inputSize, lambda, inputData, labels);%%====================================================================== %% STEP 3: Gradient checking % % As with any learning algorithm, you should always check that your % gradients are correct before learning the parameters. % if DEBUGnumGrad = computeNumericalGradient( @(x) softmaxCost(x, numClasses, ...inputSize, lambda, inputData, labels), theta);% Use this to visually compare the gradients side by sidedisp([numGrad grad]); % Compare numerically computed gradients with those computed analyticallydiff = norm(numGrad-grad)/norm(numGrad+grad);disp(diff); % The difference should be small. % In our implementation, these values are usually less than 1e-7.% When your gradients are correct, congratulations! end%%====================================================================== %% STEP 4: Learning parameters % % Once you have verified that your gradients are correct, % you can start training your softmax regression code using softmaxTrain % (which uses minFunc).options.maxIter = 100; %softmaxModel其實(shí)只是一個(gè)結(jié)構(gòu)體,里面包含了學(xué)習(xí)到的最優(yōu)參數(shù)以及輸入尺寸大小和類別個(gè)數(shù)信息 softmaxModel = softmaxTrain(inputSize, numClasses, lambda, ...inputData, labels, options);% Although we only use 100 iterations here to train a classifier for the % MNIST data set, in practice, training for more iterations is usually % beneficial.%%====================================================================== %% STEP 5: Testing % % You should now test your model against the test images. % To do this, you will first need to write softmaxPredict % (in softmaxPredict.m), which should return predictions % given a softmax model and the input data.images = loadMNISTImages('mnist/t10k-images.idx3-ubyte'); labels = loadMNISTLabels('mnist/t10k-labels.idx1-ubyte'); labels(labels==0) = 10; % Remap 0 to 10inputData = images; clear images size(softmaxModel.optTheta) size(inputData) % You will have to implement softmaxPredict in softmaxPredict.m [pred] = softmaxPredict(softmaxModel, inputData);acc = mean(labels(:) == pred(:)); fprintf('Accuracy: %0.3f%%\n', acc * 100);% Accuracy is the proportion of correctly classified images % After 100 iterations, the results for our implementation were: % % Accuracy: 92.200% % % If your values are too low (accuracy less than 0.91), you should check % your code for errors, and make sure you are training on the % entire data set of 60000 28x28 training images % (unless you modified the loading code, this should be the case)softmaxCost. m
function [cost, grad] = softmaxCost(theta, numClasses, inputSize, lambda, data, labels)% numClasses - the number of classes % inputSize - the size N of the input vector % lambda - weight decay parameter % data - the N x M input matrix, where each column data(:, i) corresponds to % a single test set % labels - an M x 1 matrix containing the labels corresponding for the input data %% Unroll the parameters from theta theta = reshape(theta, numClasses, inputSize);%將輸入的參數(shù)列向量變成一個(gè)矩陣numCases = size(data, 2);%輸入樣本的個(gè)數(shù)groundTruth = full(sparse(labels, 1:numCases, 1)); %產(chǎn)生一個(gè)100*100的矩陣,它的第labels(i)行第i列的元素值為1,其余全為0,其中i為1到numCases,即:1到100 cost = 0;thetagrad = zeros(numClasses, inputSize);%% ---------- YOUR CODE HERE -------------------------------------- % Instructions: Compute the cost and gradient for softmax regression. % You need to compute thetagrad and cost. % The groundTruth matrix might come in handy.M = bsxfun(@minus,theta*data,max(theta*data, [], 1)); % max(theta*data, [], 1)返回theta*data每一列的最大值,返回值為行向量 % theta*data的每個(gè)元素值都減去其對(duì)應(yīng)列的最大值,即:把每一列的最大值都置為0了 % 這一步的目的是防止下一步計(jì)算指數(shù)函數(shù)時(shí)溢出 M = exp(M); p = bsxfun(@rdivide, M, sum(M)); cost = -1/numCases * groundTruth(:)' * log(p(:)) + lambda/2 * sum(theta(:) .^ 2); thetagrad = -1/numCases * (groundTruth - p) * data' + lambda * theta;% ------------------------------------------------------------------ % Unroll the gradient matrices into a vector for minFunc grad = [thetagrad(:)]; endsoftmaxPredict.m
function [pred] = softmaxPredict(softmaxModel, data)% softmaxModel - model trained using softmaxTrain % data - the N x M input matrix, where each column data(:, i) corresponds to % a single test set % % Your code should produce the prediction matrix % pred, where pred(i) is argmax_c P(y(c) | x(i)).% Unroll the parameters from theta theta = softmaxModel.optTheta; % this provides a numClasses x inputSize matrix pred = zeros(1, size(data, 2));%% ---------- YOUR CODE HERE -------------------------------------- % Instructions: Compute pred using theta assuming that the labels start % from 1.% t=theta*data; % [~,pred]=max(t,[],1); % pred=pred'; [nop, pred] = max(theta * data);% pred= max(peed_temp);% ---------------------------------------------------------------------end參考文獻(xiàn)
softmax回歸
Coursera《machine learning》–(6)邏輯回歸
機(jī)器學(xué)習(xí)—-Softmax回歸
Logistic and Softmax Regression (邏輯回歸跟Softmax回歸)
Softmax回歸
Deep learning:十三(Softmax Regression)
Deep Learning 6_深度學(xué)習(xí)UFLDL教程:Softmax Regression_Exercise(斯坦福大學(xué)深度學(xué)習(xí)教程)
吳恩達(dá) Andrew Ng 的公開課
總結(jié)
以上是生活随笔為你收集整理的UFLDL教程:Exercise:Softmax Regression的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 拉卡拉收款宝会员有什么用?会员等级决定交
- 下一篇: UFLDL教程: Exercise:Se