From febf554122af9a761eaca2b9c72511c92082516a Mon Sep 17 00:00:00 2001 From: Riccardo Taormina Date: Wed, 24 Jun 2015 15:40:49 +0800 Subject: [PATCH] Sigmoid Function replaced Tanh with Sigmoid for the activation function --- ELMclassifier.m | 4 ++-- sigActFun.m | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 sigActFun.m diff --git a/ELMclassifier.m b/ELMclassifier.m index 642e8c3..9a1cf47 100644 --- a/ELMclassifier.m +++ b/ELMclassifier.m @@ -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'); @@ -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'; \ No newline at end of file diff --git a/sigActFun.m b/sigActFun.m new file mode 100644 index 0000000..a5f84de --- /dev/null +++ b/sigActFun.m @@ -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 . +% + +y = 1./(1+exp(-x)); \ No newline at end of file