test - tests the network on the testing set

USAGE

    test [<num-examples>] [-noreset | -return]

DESCRIPTION

This runs the network (forward pass only) on examples in the testing set and accumulates the overall error. If there is no testing set, the training set is used. The total error is stored in the network's error field. By default, a small report is printed to the terminal. The -return flag can be used if you instead want the report to be the command's return value.

In addition to printing the report, the numbers in the report are also stored in a global array called Test. You can access the fields in the array to easily retrieve the results of the test. The following are the available fields:

If the network has more than one output group, it prints the error and cost values for the network as a whole as well as for each output group. The error values for the individual groups are stored in the Test array as well. The values for the groups are accessed with the name of the group, followed by a . and then the field name. For example, the totalError for group output1 is stored in Test(output1.totalError).

The default behavior is to reset the testing set and run every example in it. This is also the behavior if a num-examples value of 0 is given. Otherwise, the testing set is not reset and only the next num-examples will be processed. This may be necessary if the testing set is in PIPE mode. The -noreset flag prevents the network's overall error from being reset to 0.0 prior to testing.

EXAMPLES

To test the network, resetting the error before starting:

    lens> test
    Test results on 100 examples, 700 ticks:
                         Network     
    Error total:         46.5343
    Error per example:   0.46534
    Error per tick:      0.06648
    Unit cost per tick:  2.33553
    Output unit criterion reached on 92 examples (92.00%)

    lens> puts $Test(tickError)
    0.00664776

To append the test results to a file:

    lens> set f [open "testResults" "a"]
    lens> puts $f [test -r]
    lens> close $f

SEE ALSO

train, doExample, exampleSetMode


Last modified: Mon Mar 1 14:43:22 EST 1999