99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
首頁(yè)精彩閱讀簡(jiǎn)單易學(xué)的機(jī)器學(xué)習(xí)算法—極限學(xué)習(xí)機(jī)(ELM)
簡(jiǎn)單易學(xué)的機(jī)器學(xué)習(xí)算法—極限學(xué)習(xí)機(jī)(ELM)
2017-03-23
收藏

簡(jiǎn)單易學(xué)的機(jī)器學(xué)習(xí)算法—極限學(xué)習(xí)機(jī)(ELM)

一、極限學(xué)習(xí)機(jī)的概念
    極限學(xué)習(xí)機(jī)(Extreme Learning Machine) ELM,是由黃廣斌提出來(lái)的求解單隱層神經(jīng)網(wǎng)絡(luò)的算法。
    ELM最大的特點(diǎn)是對(duì)于傳統(tǒng)的神經(jīng)網(wǎng)絡(luò),尤其是單隱層前饋神經(jīng)網(wǎng)絡(luò)(SLFNs),在保證學(xué)習(xí)精度的前提下比傳統(tǒng)的學(xué)習(xí)算法速度更快。
二、極限學(xué)習(xí)機(jī)的原理
ELM是一種新型的快速學(xué)習(xí)算法,對(duì)于單隱層神經(jīng)網(wǎng)絡(luò),ELM 可以隨機(jī)初始化輸入權(quán)重和偏置并得到相應(yīng)的輸出權(quán)重。

對(duì)于一個(gè)單隱層神經(jīng)網(wǎng)絡(luò)(見(jiàn)Figure 1),假設(shè)有個(gè)任意的樣本,其中,。對(duì)于一個(gè)有L個(gè)隱層節(jié)點(diǎn)的單隱層神經(jīng)網(wǎng)絡(luò)可以表示為

其中,為激活函數(shù),為輸入權(quán)重,為輸出權(quán)重,第個(gè)隱層單元的偏置。的內(nèi)積。

     單隱層神經(jīng)網(wǎng)絡(luò)學(xué)習(xí)的目標(biāo)是使得輸出的誤差最小,可以表示為

即存在,使得

可以矩陣表示為

其中,H是隱層節(jié)點(diǎn)的輸出,為輸出權(quán)重,T為期望輸出。

為了能夠訓(xùn)練單隱層神經(jīng)網(wǎng)絡(luò),我們希望得到使得

其中,,這等價(jià)于最小化損失函數(shù)

傳統(tǒng)的一些基于梯度下降法的算法,可以用來(lái)求解這樣的問(wèn)題,但是基本的基于梯度的學(xué)習(xí)算法需要在迭代的過(guò)程中調(diào)整所有參數(shù)。而在ELM算法中, 一旦輸入權(quán)重和隱層的偏置被隨機(jī)確定,隱層的輸出矩陣就被唯一確定。訓(xùn)練單隱層神經(jīng)網(wǎng)絡(luò)可以轉(zhuǎn)化為求解一個(gè)線性系統(tǒng)。并且輸出權(quán)重可以被確定

其中,是矩陣的Moore-Penrose廣義逆。且可證明求得的解的范數(shù)是最小的并且唯一。
三、實(shí)驗(yàn)
    我們使用《簡(jiǎn)單易學(xué)的機(jī)器學(xué)習(xí)算法——Logistic回歸》中的實(shí)驗(yàn)數(shù)據(jù)。

原始數(shù)據(jù)
我們采用統(tǒng)計(jì)錯(cuò)誤率的方式來(lái)評(píng)價(jià)實(shí)驗(yàn)的效果,其中錯(cuò)誤率公式為:

對(duì)于這樣一個(gè)簡(jiǎn)單的問(wèn)題。
MATLAB代碼
主程序
[plain] view plain copy 在CODE上查看代碼片派生到我的代碼片
%% 主函數(shù),二分類(lèi)問(wèn)題  
 
%導(dǎo)入數(shù)據(jù)集  
A = load('testSet.txt');  
 
data = A(:,1:2);%特征  
label = A(:,3);%標(biāo)簽  
 
[N,n] = size(data);  
 
L = 100;%隱層節(jié)點(diǎn)個(gè)數(shù)  
m = 2;%要分的類(lèi)別數(shù)  
 
%--初始化權(quán)重和偏置矩陣  
W = rand(n,L)*2-1;  
b_1 = rand(1,L);  
ind = ones(N,1);  
b = b_1(ind,:);%擴(kuò)充成N*L的矩陣  
 
tempH = data*W+b;  
H = g(tempH);%得到H  
 
%對(duì)輸出做處理  
temp_T=zeros(N,m);  
for i = 1:N  
    if label(i,:) == 0  
        temp_T(i,1) = 1;  
    else   
        temp_T(i,2) = 1;  
    end      
end  
T = temp_T*2-1;  
 
outputWeight = pinv(H)*T;  
 
%--畫(huà)出圖形  
x_1 = data(:,1);    
x_2 = data(:,2);    
hold on    
for i = 1 : N    
    if label(i,:) == 0    
        plot(x_1(i,:),x_2(i,:),'.g');    
    else    
        plot(x_1(i,:),x_2(i,:),'.r');    
    end    
end  
 
output = H * outputWeight;  
%---計(jì)算錯(cuò)誤率  
tempCorrect=0;  
for i = 1:N  
    [maxNum,index] = max(output(i,:));  
    index = index-1;  
    if index == label(i,:);  
        tempCorrect = tempCorrect+1;  
    end  
end  
 
errorRate = 1-tempCorrect./N;  

激活函數(shù)
[plain] view plain copy 在CODE上查看代碼片派生到我的代碼片
function [ H ] = g( X )  
    H = 1 ./ (1 + exp(-X));  
end 

數(shù)據(jù)分析咨詢請(qǐng)掃描二維碼

若不方便掃碼,搜微信號(hào):CDAshujufenxi

數(shù)據(jù)分析師資訊
更多

OK
客服在線
立即咨詢
客服在線
立即咨詢
') } function initGt() { var handler = function (captchaObj) { captchaObj.appendTo('#captcha'); captchaObj.onReady(function () { $("#wait").hide(); }).onSuccess(function(){ $('.getcheckcode').removeClass('dis'); $('.getcheckcode').trigger('click'); }); window.captchaObj = captchaObj; }; $('#captcha').show(); $.ajax({ url: "/login/gtstart?t=" + (new Date()).getTime(), // 加隨機(jī)數(shù)防止緩存 type: "get", dataType: "json", success: function (data) { $('#text').hide(); $('#wait').show(); // 調(diào)用 initGeetest 進(jìn)行初始化 // 參數(shù)1:配置參數(shù) // 參數(shù)2:回調(diào),回調(diào)的第一個(gè)參數(shù)驗(yàn)證碼對(duì)象,之后可以使用它調(diào)用相應(yīng)的接口 initGeetest({ // 以下 4 個(gè)配置參數(shù)為必須,不能缺少 gt: data.gt, challenge: data.challenge, offline: !data.success, // 表示用戶后臺(tái)檢測(cè)極驗(yàn)服務(wù)器是否宕機(jī) new_captcha: data.new_captcha, // 用于宕機(jī)時(shí)表示是新驗(yàn)證碼的宕機(jī) product: "float", // 產(chǎn)品形式,包括:float,popup width: "280px", https: true // 更多配置參數(shù)說(shuō)明請(qǐng)參見(jiàn):http://docs.geetest.com/install/client/web-front/ }, handler); } }); } function codeCutdown() { if(_wait == 0){ //倒計(jì)時(shí)完成 $(".getcheckcode").removeClass('dis').html("重新獲取"); }else{ $(".getcheckcode").addClass('dis').html("重新獲取("+_wait+"s)"); _wait--; setTimeout(function () { codeCutdown(); },1000); } } function inputValidate(ele,telInput) { var oInput = ele; var inputVal = oInput.val(); var oType = ele.attr('data-type'); var oEtag = $('#etag').val(); var oErr = oInput.closest('.form_box').next('.err_txt'); var empTxt = '請(qǐng)輸入'+oInput.attr('placeholder')+'!'; var errTxt = '請(qǐng)輸入正確的'+oInput.attr('placeholder')+'!'; var pattern; if(inputVal==""){ if(!telInput){ errFun(oErr,empTxt); } return false; }else { switch (oType){ case 'login_mobile': pattern = /^1[3456789]\d{9}$/; if(inputVal.length==11) { $.ajax({ url: '/login/checkmobile', type: "post", dataType: "json", data: { mobile: inputVal, etag: oEtag, page_ur: window.location.href, page_referer: document.referrer }, success: function (data) { } }); } break; case 'login_yzm': pattern = /^\d{6}$/; break; } if(oType=='login_mobile'){ } if(!!validateFun(pattern,inputVal)){ errFun(oErr,'') if(telInput){ $('.getcheckcode').removeClass('dis'); } }else { if(!telInput) { errFun(oErr, errTxt); }else { $('.getcheckcode').addClass('dis'); } return false; } } return true; } function errFun(obj,msg) { obj.html(msg); if(msg==''){ $('.login_submit').removeClass('dis'); }else { $('.login_submit').addClass('dis'); } } function validateFun(pat,val) { return pat.test(val); }