Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/n3pdf/pycompressor

Compression code for PDF replicas.
https://github.com/n3pdf/pycompressor

hep-ph high-energy-physics physics python

Last synced: 12 days ago
JSON representation

Compression code for PDF replicas.

Awesome Lists containing this project

README

        


pyCompressor



Fast and efficient compression code for Monte Carlo PDF sets





DOI
DOI

### New features

Additional new features have been added to the following python package. The two main features are:


Covariance Matrix Adaptation-Evlotion strategy
In addition to the Genetic Algorithm (GA) implemented in the original compression, there is now the possibility to choose
as a minimizer the CMA. The choice of minimizer can be defined in the runcard.yaml file.



Generative Adversarial Strategy (GANs)
This is a standalone python package
that can enhance the statistics of the prior PDF replicas before compression by generating
synthetic replicas. For more details, refer to the documentation.
In a similar way, in order to trigger the enhancement, one just has to set the value of enhanced
in the runcard to be True. Setting this value to False will just run the standard
compression. The GANs also requires extra-parameters (as shown in the example
runcard.yaml) that
defines the structure of the networks.

### Installation

To install `pyCompressor`, just type:
```bash
python setup.py install
```
or if you are a developer:
```bash
python setup.py develop
```

### How to use

The input parameters that define the compression is contained in a YAML file. To run
the `pyCompressor` code, just type the following:
```bash
pycomp runcards/runcard.yml [--threads NUMB_THREADS]
```
A detailed instruction on how to set the different parameters in the runcard can be found [here](https://n3pdf.github.io/pycompressor/howto/howto.html).
And to controo the parallelization, have a look at the following [section](https://n3pdf.github.io/pycompressor/howto/howto.html#controlling-the-parallelization).
Notiice that by default, the methodology is based on the [standard](https://arxiv.org/abs/1504.06469) approach.
In order to compress from an enhanced set, the entry `existing_enhanced` has to be set to `True`.

### Generating compressed PDF set & post-analysis

The code will create a folder named after the prior PDF sets. To generate the
compressed PDF grid, run the following command:
```bash
get-grid -i /compressed___output.dat
```
Note that if the compression is done from an enhanced set, the output folder will be append by `_enhanced`.

Finally, in order to generate ERF plots, enter in the `erfs_output` directory and run the following:
```bash
validate --random erf_randomized.dat --reduced erf_reduced.dat
```
This script can also plot the ERF validation from the old compressor code by adding the flag
`--format ccomp`.

### Citation

If you use the package please at least cite one of the followings:

```bibtex
@article{Carrazza:2021hny,
author = "Carrazza, Stefano and Cruz-Martinez, Juan M. and Rabemananjara, Tanjona R.",
title = "{Compressing PDF sets using generative adversarial networks}",
eprint = "2104.04535",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
doi = "10.1140/epjc/s10052-021-09338-8",
journal = "Eur. Phys. J. C",
volume = "81",
number = "6",
pages = "530",
year = "2021"
}

@software{pycompressor,
author = {Rabemananjara, Tanjona R. and Cruz-Martinez, Juan M. and Carrazza, Stefano},
title = {N3PDF/pycompressor: pycompressor v1.1.0},
month = Mar.,
year = 2020,
publisher = {Zenodo},
version = {v1.1.0},
doi = {10.5281/zenodo.4616385},
url = {https://doi.org/10.5281/zenodo.4616385}
}
```