The CompareStat provides a general way of comparing the results of different statistics with each other. Thus, one can actually use statistics to analyze one's data on-line, instead of dumping it all to a file and analyzing it after the fact.
Similarly, the ComputeStat provides a general way of performing simple math computations on the results of other stat computations. It can be used on one stat (e.g., for thresholding, absolute-value or other single-argument operations), or on two stats (e.g., for multiplying, subtracting, etc between two stats).
The compare stat contains pointers to two other stats, stat_1
and
stat_2
, which provide the data to compare. The data consists of
any stat val data that can be found on these stats. Ideally, they both
have the same number of data values, typically in their copy_vals
group (e.g., from MonitorStats that are COPY
ing activations
from two sets of units that are being compared).
The types of comparisons are simply different distance functions that measure the distances between the two stat's data:
CompareType cmp_type
SUM_SQUARES
EUCLIDIAN
HAMMING_DIST
COVAR
CORREL
INNER_PROD
CROSS_ENTROPY
float dist_tol
bool norm
INNER_PROD
is being taken, this will result in a normalized
inner-product measure (dividing by the magnitudes of the individual
weight vectors).
SimpleMathSpec pre_proc_1,2,3
arg
member. Note that the
thresholding function THRESH
compares the value to the
arg
, and gives a result of hi
if it is
greater-than-or-equal, and lo
if it is less-than the arg.
The ComputeStat is like the compare stat, except that instead of
computing the distance, the compute_1,2,3
math operators are
applied on the stats, and the result is aggregated according to
net_agg
. Pre-processing of each stat independently is supported
as with the compare stat. To compute something between two stats (e.g.,
subtract values), then you just set the compute_1 operator opr
to
SUB
, and stat_2 values are subtracted from stat_1 values, with
the result going into stat_1. Subsequent compute_ operators can then
manipulate this result (e.g, doing the SQUARE
). Note that they
don't all have to involve both stats, and you can only use one stat (in
which case compute_x just works like pre_proc_x).