12.8.3 Finding The Event Closest to the Current Output Pattern

In order to understand what kinds of errors a network is making, or in the case where a network can produce multiple outputs for a given input, it is useful to be able to compare the actual output the network came up with against all of the possible training events to find the one that matches the closest. The ClosestEventStat does exactly that.

The closest event stat reports both the distance in the dist field, and the name of the event which was closest to the current output pattern in the ev_nm field. If the ev_nm matches that of the currently presented event (cur_event of the TrialProcess), then sm_nm is 1, else it is 0. The average of this value gives a "percent correct" measure for forced-choice performance among the different items in the environment. The distance can be computed in several different ways, as described below:

CompareType cmp_type
This is the type of distance function to use in making the comparison:
SUM_SQUARES
sum of squares distance: sum[(x-y)^2]
EUCLIDIAN
euclidean distance: sqrt(sum[(x-y)^2])
HAMMING_DIST
hamming distance: sum[abs(x-y)]
COVAR
covariance: sum[(x-<x>)(y-<y>)]
CORREL
correlation: sum[(x-<x>)(y-<y>)] / sqrt(sum[x^2 y^2])
INNER_PROD
inner product: sum[x y]
CROSS_ENTROPY
cross entropy: sum[x ln(x/y) + (1-x)ln((1-x)/(1-y))]
float dist_tol
This is a tolerance value for distance comparisons, where absolute differences below this amount result in a 0 distance component.
bool norm
If this flag is checked, and one of the distance comparisons is being performed, the values participating in the distance computation will be normalized to a zero-one range prior to computation. If the INNER_PROD is being taken, this will result in a normalized inner-product measure (dividing by the magnitudes of the individual weight vectors).