test [<num-examples>] [-noreset | -return]
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:
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.
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