def h5_hist_data(filename, epoch_axis=True):
 ret = list()
 with h5py.File(filename, 'r') as f:
  if ('hist' in f):
   (hists, config) = [f[x] for x in ['hist', 'config']]
   (bins, offset, time_markers) = [hists.attrs[x] for x in ['bins', 'offset', 'time_markers']]
   total_epochs = config.attrs['total_epochs']
   total_minibatches = config.attrs['total_minibatches']
   for (hname, hdata) in hists.items():
    dw = (total_epochs if (time_markers == 'epoch_freq') else total_minibatches)
    dh = bins
    ret.append((hname, hdata[...], dh, dw, bins, offset))
 return ret

def h5_hist_data ( filename , epoch_axis = True ) : ret = list ( ) with h5py . File ( filename , 'r' ) as f : if ( 'hist' in f ) : ( hists , config ) = [ f [ x ] for x in [ 'hist' , 'config' ] ] ( bins , offset , time_markers ) = [ hists . attrs [ x ] for x in [ 'bins' , 'offset' , 'time_markers' ] ] total_epochs = config . attrs [ 'total_epochs' ] total_minibatches = config . attrs [ 'total_minibatches' ] for ( hname , hdata ) in hists . items ( ) : dw = ( total_epochs if ( time_markers == 'epoch_freq' ) else total_minibatches ) dh = bins ret . append ( ( hname , hdata [ ... ] , dh , dw , bins , offset ) ) return ret
read histogram data from hdf5 file .