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

[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 07:28:37 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

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

                 Summary: hardlims nerual nets function returns always an
scalar
                 Project: GNU Octave
            Submitted by: robertus85
            Submitted on: ven 14 ago 2015 07:28:36 GMT
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Roberto Ratti
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Good morning,
during some exercises about neurual nets functions, i found a difference of
results between hardlim function and hardlims (..../packages/nnet-0.1.13).
The first one returned correctly a vector, the second one returned always a
scalar.
(Actually the only difference should be that hardlims returns -1 when hardlim
returns 0)

You can see, in the image attatched (octave_hardlims_orig.png).

The code of hardlims function was:


function a = hardlims(n)
  if n>=0
    a=1;
  else
    a=-1;
  endif
endfunction


I modified that code in this:


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


Now it returns correctly a vector when input is a vector (attatched image
octave_hardlims_modif.png).
I'm not sure that my code is the best way for the function, but i hope that it
could be useful.

Thank you.
Roberto Ratti
address@hidden



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: ven 14 ago 2015 07:28:37 GMT  Name: octave_hardlims_orig.png  Size: 16kB
  By: robertus85

<http://savannah.gnu.org/bugs/download.php?file_id=34642>
-------------------------------------------------------
Date: ven 14 ago 2015 07:28:37 GMT  Name: octave_hardlims_modif.png  Size:
15kB   By: robertus85

<http://savannah.gnu.org/bugs/download.php?file_id=34643>

    _______________________________________________________

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]