(tfpopstats, nppopstats)
Prints the average and std of population versus batch statistics.
Prints the average and std of population versus batch statistics.
Prints the average and std of population versus batch statistics .
def _print_popstat_info(tfpopstats, nppopstats):
  """Prints the average and std of population versus batch statistics."""
  mean_errors = []
  stdev_errors = []
  for j, (tfpopstat, nppopstat) in enumerate(zip(tfpopstats, nppopstats)):
    moving_average = tfpopstat.eval()
    if j % 2 == 0:
      mean_errors.append(abs(moving_average - nppopstat))
    else:
      stdev_errors.append(abs(np.sqrt(moving_average) - np.sqrt(nppopstat)))

  def flatmean(xs):
    return np.mean(np.concatenate([x.flatten() for x in xs]))

  print('average of pop mean/stdev errors: %g %g' % (flatmean(mean_errors),
                                                     flatmean(stdev_errors)))
  print('average of batch mean/stdev: %g %g' %
        (flatmean(nppopstats[0::2]),
         flatmean([np.sqrt(ugh) for ugh in nppopstats[1::2]])))
def _print_popstat_info ( tfpopstats , nppopstats ) : mean_errors = [ ] stdev_errors = [ ] for j , ( tfpopstat , nppopstat ) in enumerate ( zip ( tfpopstats , nppopstats ) ) : moving_average = tfpopstat . eval ( ) if j % 2 == 0 : mean_errors . append ( abs ( moving_average - nppopstat ) ) else : stdev_errors . append ( abs ( np . sqrt ( moving_average ) - np . sqrt ( nppopstat ) ) ) def flatmean ( xs ) : return np . mean ( np . concatenate ( [ x . flatten ( ) for x in xs ] ) ) print ( 'average of pop mean/stdev errors: %g %g' % ( flatmean ( mean_errors ) , flatmean ( stdev_errors ) ) ) print ( 'average of batch mean/stdev: %g %g' % ( flatmean ( nppopstats [ 0 : : 2 ] ) , flatmean ( [ np . sqrt ( ugh ) for ugh in nppopstats [ 1 : : 2 ] ] ) ) )