Skip to content

Commit

Permalink
Sigmoid Function
Browse files Browse the repository at this point in the history
replaced Tanh with Sigmoid for the activation function
  • Loading branch information
rtaormina committed Jun 24, 2015
1 parent bda6882 commit febf554
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ELMclassifier.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
bias = rand(nUnits,1);

% compute hidden neuron output matrix H
H = tanhActFun(W1*trX + repmat(bias,[1,nPatternsTr]));
H = sigActFun(W1*trX + repmat(bias,[1,nPatternsTr]));

% compute hidden->output weights W2
Hinv = pinv(H');
Expand All @@ -70,7 +70,7 @@
trYhat = temp';

% ... and validation dataset
Hval = tanhActFun(W1*valX + repmat(bias,[1,nPatternsVal]));
Hval = sigActFun(W1*valX + repmat(bias,[1,nPatternsVal]));
temp = (Hval' * W2)';
[~,temp] = max(temp,[],1);
valYhat = temp';
31 changes: 31 additions & 0 deletions sigActFun.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function y = sigActFun(x)
% sigmoid activation function for ELM
%
%
%
% Copyright 2015 Riccardo Taormina (riccardo_taormina@sutd.edu.sg),
% Gulsah Karakaya (gulsahkilickarakaya@gmail.com;),
% Stefano Galelli (stefano_galelli@sutd.edu.sg),
% and Selin Damla Ahipasaoglu (ahipasaoglu@sutd.edu.sg;.
%
% Please refer to README.txt for further information.
%
%
% This file is part of Matlab-Multi-objective-Feature-Selection.
%
% Matlab-Multi-objective-Feature-Selection is free software: you can redistribute
% it and/or modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation, either version 3 of the
% License, or (at your option) any later version.
%
% This code is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with MATLAB_IterativeInputSelection.
% If not, see <http://www.gnu.org/licenses/>.
%

y = 1./(1+exp(-x));

0 comments on commit febf554

Please sign in to comment.