Code Monkey home page Code Monkey logo

mass_decorrelated_hbb_tagger's Introduction

Mass-decorrelated Xbb Tagger using Adversarial Neural Networks

For training and evaluating mass-decorrelated Hbb vs. Dijets tagger and Hbb vs. Top tagger.

Setup

  1. Clone the package:
$ git clone https://github.com/allenshihlung/mass_decorrelated_hbb_tagger.git
$ cd adversarial-master
  1. Install miniconda and other dependencies to create the appropriate software environments:
$ source install.sh
  1. Add path to .bashrc in your ~ directory
$ cd ~
$ cat "export PATH=<path to your the bin directory of your miniconda installation>:$PATH"
  1. Activate the conda environment
$ cd <path to your adversarial-master directory>
$ source activate.sh

Data-preprocessing

  1. Gather all .h5 datasets into hbbDijetsDatasets/ or hbbTopDatasets/ On PDSF, this can be done by
$ python dataprocessing/getHbbDijetsDatasets.py

or

$ python dataprocessing/getHbbTopDatasets.py

Note that the name of each dataset has to follow the following format:

.h5 For example:

user.dguest.15830754._000001.output_301498_H.h5

and

user.dguest.15830705._000040.output_361027_N.h5
  1. Label the datasets
$ python dataprocessing/labelDatasets.py

This will place the labelled datasets into labelledHbbDijetsDatasets/ or labelledHbbTopDatasets/

  1. Extract necessary columns for reweighting (we will add the other columns back after reweighting)
$ python dataprocessing/extractPtAndWeight.py

This will place the labelled datasets into extractedHbbDijetsDatasets/ or extractedHbbTopDatasets/

  1. Reweight and subsample
$ python -m prepro.reweightData --train <test events to subsample in millions> --test <test events to subsample in millions> --max-processes <max concurrent processes to be spun off>

This will place the processed extractedData.h5 file in reweightDatasets/

  1. Append all other columns back
$ python dataprocessing/appendData.py

This will place the processed data.h5 file in input/

Ready to go for training!

Training

For training with the default configuration:

$ python -m run.adversarial.train --train

To make any changes to the configurations, locate the default.json file in the configs/.

Performance tests

Locate the perform_studies function in tests/comparison.py and comment out or uncomment any study. Then run

$ python -m tests.comparison

The plots will be saved in figures/

mass_decorrelated_hbb_tagger's People

Contributors

allenshihlung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.