[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45754] hardlims nerual nets function returns
From: |
Roberto Ratti |
Subject: |
[Octave-bug-tracker] [bug #45754] hardlims nerual nets function returns always an scalar |
Date: |
Fri, 14 Aug 2015 11:58:09 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0 |
Follow-up Comment #1, bug #45754 (project octave):
Same problem (and same solution) for functions satlin and satlins
function a = satlin(n)
####### here commented, the original code #########
##if (n<0)
## a = 0;
##elseif (n>=0 && n<=1)
## a = n;
##else
## a = 1; # if n>1
##endif
###################################################
for i=1:size(n, 1)
for j=1:size(n, 2)
if (n(i,j)<0)
a(i,j) = 0;
elseif (n(i,j)>=0 && n(i,j)<=1)
a(i,j) = n(i,j);
else
a(i,j) = 1; # if n>1
endif
end
end
endfunction
function a = satlins(n)
####### here commented, the original code #########
##if (n<-1)
## a = -1;
##elseif (n>=-1 && n<=1)
## a = n;
##else
## a = 1; # if n>1
##endif
###################################################
for i=1:size(n,1)
for j=1:size(n,2)
if (n(i,j)<-1)
a(i,j) = -1;
elseif (n(i,j)>=-1 && n(i,j)<=1)
a(i,j) = n(i,j);
else
a(i,j) = 1; # if n>1
endif
end
end
endfunction
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45754>
_______________________________________________
Messaggio inviato con/da Savannah
http://savannah.gnu.org/