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

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

[Octave-bug-tracker] [bug #40101] fminunc outputs - gradient and hessian


From: jose
Subject: [Octave-bug-tracker] [bug #40101] fminunc outputs - gradient and hessian not always calculated in the solutio
Date: Wed, 25 Sep 2013 16:47:44 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36

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

                 Summary: fminunc outputs - gradient and hessian not always
calculated in the solutio
                 Project: GNU Octave
            Submitted by: josombio
            Submitted on: Wed 25 Sep 2013 04:47:43 PM GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Jose
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

The iteration of fminunc can finish because of several reasons. The particular
reason can be checked from the 3rd output (the info).

If I am not mistaken, it seems that when fminunc reaches any of the exit
conditions corresponding to info equal to -1, 2 or 3, the gradient is not
recalculated after the last modification of x (See lines 283 for the last
update of x, and lines 301, 320 and 323 for changes of the variable info that
result in exit conditions).

As a consequence, the gradient returned in the output in those cases does not
correspond to the gradient calculated in the x returned as output, but to the
gradient calculated using the x of the previous iteration.

The file attached (fminunc2.m) is an attempt to fix this. It also recalculates
the hessian (using blind copy-paste from the code!!). It has been tested only
with a case in which info=3.
Additionally, the fix returns the gradient in the same shape than x.

Find attached (session.txt) one way to reproduce the problem when info=3.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 25 Sep 2013 04:47:43 PM GMT  Name: fminunc2.m  Size: 13kB   By:
josombio
A fix-attempt
<http://savannah.gnu.org/bugs/download.php?file_id=29209>
-------------------------------------------------------
Date: Wed 25 Sep 2013 04:47:43 PM GMT  Name: session.txt  Size: 1kB   By:
josombio
A fix-attempt
<http://savannah.gnu.org/bugs/download.php?file_id=29210>

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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