Code covered by the BSD License
 CalcErrorRate( dbn, IN, O...CalcErrorRate: calculate error rate
 CalcRmse( dbn, IN, OUT )CalcRmse: calculate the rmse between predictions and OUTs
 GetDroppedDBN(dbn, DropOu...GetDroppedDBN: get dropped dbn
 GetOnInd( dbn, DropOutRat...GetOnInd: get indexes which are used (not dropped) nodes
 SetLinearMapping( dbn, IN...SetLinearMapping: set the RBM associated to the linear mapping to the last layer
 h2v(dnn, H)
h2v: to transform from hidden (output) variables to visible (input) variables
 linearMapping( IN, OUT )
linearMaping: calculate the linear mapping matrix between the input data and the output data
 mnistread( mnistfilenames )
 pretrainDBN(dbn, V, opts)
pretrainDBN: pretraining the Deep Belief Nets (DBN) model by Contrastive Divergence Learning
 pretrainRBM(rbm, V, opts )pretrainRBM: pretraining the restricted boltzmann machine (RBM) model by Contrastive Divergence Learning
 randDBN( dims, type )
randDBN: get randomized Deep Belief Nets (DBN) model
 randRBM( dimV, dimH, type )
randRBM: get randomized restricted boltzmann machine (RBM) model
 sigmoid(x)
sigmoid: calculate sigmoid function
 trainDBN( dbn, IN, OUT, o...trainDBN: training the Deep Belief Nets (DBN) model by back projection algorithm
 v2h(dnn, V)
v2h: to transform from visible (input) variables to hidden (output) variables
 v2hall(dnn, V)v2hall: to transform from visible (input) variables to all hidden (output) variables
 evaMNIST.m
 testDNN.m
 testMNIST.m
 trainMNIST.mif you want to test with small number of samples,

View all files
Deep Neural Network
by
Masayuki Tanaka
29 Jul 2013
(Updated
13 Jan 2014)
It provides deep learning tools of deep belief networks (DBNs).

CalcRmse( dbn, IN, OUT ) 
% CalcRmse: calculate the rmse between predictions and OUTs
%
% [rmse AveErrNum] = CalcRmse( dbn, IN, OUT )
%
%
%Output parameters:
% rmse: the rmse between predictions and OUTs
% AveErrNum: average error number after binarization
%
%
%Input parameters:
% dbn: network
% IN: input data, where # of row is # of data and # of col is # of input features
% OUT: output data, where # of row is # of data and # of col is # of output labels
%
%
%Version: 20130727
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Deep Neural Network: %
% %
% Copyright (C) 2013 Masayuki Tanaka. All rights reserved. %
% mtanaka@ctrl.titech.ac.jp %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [rmse AveErrNum] = CalcRmse( dbn, IN, OUT )
out = v2h( dbn, IN );
err = power( OUT  out, 2 );
rmse = sqrt( sum(err(:)) / numel(err) );
bout = out > 0.5;
BOUT = OUT > 0.5;
err = abs( BOUT  bout );
AveErrNum = mean( sum(err,2) );
end


Contact us