octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45754] neural net package :hardlims function


From: Roberto Ratti
Subject: [Octave-bug-tracker] [bug #45754] neural net package :hardlims function returns always an scalar
Date: Wed, 26 Aug 2015 19:59:49 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

Follow-up Comment #3, bug #45754 (project octave):

Hi,
i post code and attach examples use of functions.


function a = hardlims(n)

  for i=1:size(n,1)
    for j=1:size(n,2)
     if n(i,j)>=0
      a(i,j)=1;
     else 
      a(i,j)=-1;
     endif
    end
  end

endfunction

function a = satlin(n)
  
  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)

  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





file attached are:
variables.png
hardlims.png
satlin.png
satlins.pg

(file #34744, file #34745, file #34746, file #34747)
    _______________________________________________________

Additional Item Attachment:

File name: variables.png                  Size:19 KB
File name: satlin.png                     Size:15 KB
File name: hardlims.png                   Size:11 KB
File name: satlins.png                    Size:16 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45754>

_______________________________________________
  Messaggio inviato con/da Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]