# The data shows a normal distribution, so we're going to use a # logistic mapping function. # This time, load the entire dataset into memory. word_vecs = h5f['word_vecs'][:] # Calculate the mean using a sample of the vectors. center = np.mean(word_vecs[0:sample_size].flatten()) # Verify that the mean is roughly zero. assert(abs(center - 0.0) < 0.01) # Learn the parameters for the logistic mapping function. # The mapping function will saturate at 8 standard deviations, and will convert # the values to 8-bit integers. tf = Transforms.Transforms(np.uint8) standard_deviations = 8 tf.learn_logistic(word_vecs, num_std=standard_deviations) # Apply logistic mapping to the dataset vectors. word_vecs_int = tf.apply_logistic(word_vecs) # Load the query vectors into memory and map the values. query_vecs = h5f['query_vecs'][:] # Apply logistic mapping to the query vectors. query_vecs_int = tf.apply_logistic(query_vecs) # Take a small subset of the dataset and plot a histogram of the values.
if my_args.output != None: plotpath = my_args.output + "/" # DATA_PATH = "./data/pythia/" # filename = "reco_simu_Zdd.csv" # # BCG_PATH = './data/' # Filename_background = "reco_0.csv" h = Hits.Hits(filename) ev = Hits.Event(h) #, 11) # h.drawAllEvents() # Combine events (background, or several events) # ev.combineEvents([Hits.Event(h_background)]) # ev.combineEvents([Hits.Event(h, 12), Hits.Event(h, 11)]) ev.drawEvent3D(plotName=plotpath + "3D_Zdd.pdf") # ev.drawEventXY()#plotName=plotpath+"3tracks_XY.pdf") # ev.drawEventXZ() # ev.drawEventYZ() d = ev.data tr = Transforms.Transforms(ev) H, xedges, yedges = tr.HoughTransform_phi(numpoints=200, binx=200, biny=50, plotName=plotpath + "HT_Zdd_maxima.pdf") tr.plotConformalTransform(plotpath + "CT_Zdd.pdf")