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: Philip Nienhuis
Subject: Re: Using keyboard command for debugging
Date: Tue, 04 Feb 2014 19:06:50 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:25.0) Gecko/20100101 Firefox/25.0 SeaMonkey/2.22.1

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



reply via email to

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