new_contents: #!/usr/bin/env python
  
  """
  Print average channel values for a collection of models, such as that serialized
  by TrainCV. Based on print_monitor.py
  """
  __author__ = "Steven Kearnes"
  
  import sys
  from pylearn2.utils import serial
  import numpy as np
  
  
  def main():
      epochs = []
      time = []
      values = {}
      for filename in sys.argv[1:]:
          models = serial.load(filename)
          for model in list(models):
              monitor = model.monitor
              channels = monitor.channels
              epochs.append(monitor._epochs_seen)
              time.append(max(channels[key].time_record[-1] for key in channels))
              for key in sorted(channels.keys()):
                  if key not in values:
                      values[key] = []
                  values[key].append(channels[key].val_record[-1])
      print 'epochs seen: {} +/- {}'.format(np.mean(epochs), np.std(epochs))
      print 'training time: {} +/- {}'.format(np.mean(time), np.std(time))
      for key in sorted(values.keys()):
          print '{}: {} +/- {}'.format(key, np.mean(values[key]),
                                       np.std(values[key]))
  
  if __name__ == '__main__':
      main()
  
  
subject: Add print_monitor_average.py