12.8.6 Miscellaneous Other Stat Types

The CyclesToSettle statistics simply records the number of cycles it took to settle. It should be placed in the loop_stats of the trial process, where it will be able to grab the final counter value from the settle process. This is useful to record how fast a network is settling, which is often used as a proxy for reaction times, etc.

The ScriptStat is a statistic that is meant to be used with a CSS script. It provides a generic group of vals into which the results of the statistic can be put, and an array of s_args for passing arguments to the script to control its behavior. A very simple example script code for computing the difference between two unit activations is as follows:

// this is a sample script stat script

void DoStat() {
  if(vals.size != 1) {  // first, create vals to hold results
    // anything in vals is automatically logged, etc.
    vals.EnforceSize(1);  // do whatever is necessary to get 1 val
    vals[0].name = "act_diff";  // this is the header for the stat val
  }
  // get the first unit (note that we can access 'network'
  // and other member variables from the ScriptStat the script is in)
  Unit* un1 = network.layers[1].units[0];
  // and then the second unit
  Unit* un2 = network.layers[1].units[1];

  // compute value to put in statistic
  float diff = un1->act - un2->act;

  // then store result in the val.  note you can have as many
  // vals as you want and compute as many things as you want!
  vals[0].val = diff;
}

// you *must* call the function so that when the script is run
// the above function is actually run!
DoStat();

The EpochCounterStat records the current epoch number from the network. This is useful for testing process hierarchies which start at the epoch level and thus do not have an epoch counter from the training process.

The ProcCounterStat grabs a whole set of counters off of another process. It is used for the same reason an epoch counter stat is used, except it also gives one access to batch counters and any other counters that might be present on the training process hierarchy.