help-octave
[Top][All Lists]
Advanced

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

Re: Using keyboard command for debugging


From: syed khalid
Subject: Re: Using keyboard command for debugging
Date: Tue, 4 Feb 2014 19:21:11 -1000

Hi,
  Thanks for the response. Here is are some of the outputs

debug> isfinite(show)
ans = 0
debug> length(stop)
ans = 0
debug> isfinite(show) & (!rem(iEpochs,show) | length(stop))
error: showtrainprogress: invalid conversion from NaN to logical
debug> rem(0,NaN)
ans = NaN
debug> !rem(1,NaN)
error: showtrainprogress: invalid conversion from NaN to logical

debug> !rem(iEpochs,show)
error: showtrainprogress: invalid conversion from NaN to logical

debug> rem(iEpochs,show)
ans = NaN

debug> disp (iEpochs)
0
debug> disp (epochs)
 100
debug> who
Variables in the current scope:

argn         goal         net          shortStr     time
currentTime  iEpochs      normGradX    show
epochs       minGrad      perf         stop

debug> whos
Variables in the current scope:

   Attr Name             Size                     Bytes  Class
   ==== ====             ====                     =====  =====
  a     argn            12x11                       132  char
    f   currentTime      1x1                          8  double
    f   epochs           1x1                          8  double
    f   goal             1x1                          8  double
    f   iEpochs          1x1                          8  double
    f   minGrad          1x1                          8  double
    f   net              1x1                        891  struct
    f   normGradX        1x1                          8  double
    f   perf             1x1                          8  double
    f   shortStr         1x7                          7  char
    f   show             1x1                          8  double
    f   stop             0x0                          0  char
    f   time             1x1                          8  double

Total is 149 elements using 1102 bytes

debug> dbstack
stopped in:




On Tue, Feb 4, 2014 at 8:06 AM, Philip Nienhuis <address@hidden> wrote:
Please do "reply all" so other people on the list can also benefit.

address@hidden wrote:
Hello Philip
    Thank you very much for your response about my question shown below. I did insert the "keyboard" command on line 302. Am using "disp" to show the variables. However, am a bit of a loss as to what and how to display the variables. Here is the code

function showtrainprogress(show,stop,iEpochs,epochs,time,currentTime, \
           goal,perf,minGrad,normGradX,shortStr,net)

     ## check number of inputs
     error(nargchk(12,12,nargin));
keyboard

## show progress
     if isfinite(show) & (!rem(iEpochs,show) | length(stop))
       fprintf(shortStr);   # outputs the training algorithm
       if isfinite(epochs)
         fprintf(", Epoch %g/%g",iEpochs, epochs);
       endif
       if isfinite(time)
         fprintf(", Time %4.1f%%",currentTime/time*100);   # \todo: Time


I tried a few debug disp commands
debug> disp (iEpochs)
0
debug> disp (epochs)
  100
debug>

You don't need disp(); just typing the name of the variable will do.

Anyway are those values "valid"? are they OK?


You indicated rem() might be the culprit. I am having bridging the gap as to what to do next. Should I try to display    !rem(iEpochs,show) | length(stop) ??

Have you tried simply typing:

!rem(iEpochs,show)

at the Octave prompt in debug mode (i.e., when execution stops at the keyboard statement)?
It looks like a valid Octave statement so why not try?

If you get errors that's because then the bug is there. So if that is the case you could then try (at the Octave prompt):

show

isfinite(show) & (!rem(iEpochs,show) | length(stop))

length(stop)

etc etc

Philip




--
Syed Khalid
 
CEO
 
Pacific Cloud
 
1-408-655-1096

reply via email to

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