Skip to content

Instantly share code, notes, and snippets.

View jmduarte's full-sized avatar

Javier Duarte jmduarte

View GitHub Profile
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import mplhep as hep
mlp_data = {
"W2A2": [2.7 * 10**6, 86.2],
"W3A3": [4.2 * 10**6, 89.7],
"W8A8": [1.8 * 10**7, 90.5],
"FP": [2.8 * 10**8, 90.4],
import numpy as np
import random as rnd
import hls4ml
from tensorflow.keras.layers import Conv2D, MaxPooling2D, BatchNormalization
from qkeras.qconvolutional import QConv2D
from qkeras.quantizers import quantized_bits, quantized_relu
from tensorflow.keras.models import Sequential
from qkeras import QActivation
height = 8
@jmduarte
jmduarte / convert_top.py
Created October 7, 2019 16:07 — forked from hqucms/convert_top.py
Convert top tagging dataset
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import logging
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)s] %(levelname)s: %(message)s')
import pandas as pd
@jmduarte
jmduarte / JSD_Limit.py
Last active September 19, 2019 23:23 — forked from eric-moreno/JSD Limit
def get_jsd_limit(frame=[], epsilonB=0.1):
ndatapoints = 100
mmin = 40
mmax = 200
nbins = 8
frame = frame.loc[frame['truthQCD'] == 1]
N = len(frame)
nB = N*epsilonB