Miscellanea: Common Problems

Examples or Events Not Running To Completion

When running a network that uses more than one tick per example, it appears common to encounter problems with examples or events not running as long as you expect them to. If this happens, the first thing to do is to check the network's timeIntervals and ticksPerInterval. The product of these is the maximum number of ticks the network will run on any example, regardless of the number of events in the example.

If that is not the solution, then it should be the case that every event in the example is being run for at least its minTime. If this isn't happening, check the minTime fields in the example set and in the events to make sure that your example file was being parsed as you expected. Also check the trainGroupCrit and testGroupCrit values in the network and the output groups to be sure they are low enough. Note that if the event uses NaN targets, the group criteria will automatically be met if you are using the STANDARD_CRIT function so the event will only last as long as its minTime.

Display Problems/Batch Mode

Even if you are running with the -nogui option, you must have a valid DISPLAY environment variable and your machine must be allowed to control that display, as determined by the xhost command. If you wish to run without using a display, -batch should be used rather than -nogui.

Any command that deals with the display will not be available in batch mode. If executed, these commands will return a message, but not with an error code. Therefore, scripts that use them should continue. Some Tcl commands (actually Tk commands), such as option, will not available in batch mode. These may return errors which could damage your scripts. If you want to put some code in a script that should not be executed in batch mode, you can access the .BATCH Tcl variable to protect it, as in the following:

    if {${.BATCH}} {
      do graphical stuff

Locked Shell

If you hit certain control keys, such as End, "Page Down", or an arrow key at the Lens shell prompt, you may see symbols such as this: "^[[F^[[6~". If you then hit Enter, the shell will enter the secondary prompt, >, seemingly never to return.

Actually, what has happened is that the control keys have the same effect as an open square brace. The shell thinks you are working on a command substitution and is waiting for you to close those braces before it will consider the command complete. Try typing "]" followed by Enter several times until the main prompt returns.

Problems Reading from a Pipe

If you are reading from a pipe, typically while loading examples, and problems occur when the pipe closes or Lens exits, try this solution.

Periodic Events

Let's say you were to unleash the following command in your shell:

    proc count i {
        puts $i
        after 1000 "count [incr i]"
    count 0

Go ahead, try it. It's fun. You might actually use a similar periodic command to automatically save the weights in your network at certain time intervals. Now how would you stop it? One low-tech solution is to remove the count command using "rename count {}" or even just changing the name. The next time it is called the loop will die.

Viewing Code in the Browser

Some web browsers may not recognize files ending in ".tcl" or ".in" as code files and will not display those files inline. This can usually be fixed in the Preferences or Options by telling the browser that ".tcl" and ".in" files should be treated as text.

For example, in Netscape 4.0x, this can be done by opening the "Edit/Preferences..." dialog. Now click on the category "Navigator/Applications". Highlight "Plain Text" in the box on the right and press "Edit". Now add "c,h,tcl,in" to the list of suffixes to be treated as text, if they are not already there.

Douglas Rohde
Last modified: Tue Nov 14 00:02:19 EST 2000