Draft: Adapt Par04 to support ML models with pyTorch and ONNXRuntime

Open Michal Mazurek requested to merge mimazure-geant4-par04-pyTorch-inference into master

@azaborow @dasalama @landerli @gcorti @admorris

This prepares the Par04 adaptation in Gaussino in !122 (merged) to support fast simulations via ML inference with the interface to pyTorch C++ API as developed in !55.

The inference is performed in a separate Gaudi algorithm. It takes a latent vector, incident particle energy & angle as input. Incident particle information is carried by 'collector' hits, i.e. hits produced by the immediate deposit model, in which tracks are killed when entering the sensitive area and all of the particle's energy gets deposited in a single hit. The latent vector is a vector of pseudo-random numbers sampled from a flat distribution with the same engine that is used everywhere else in Gaussino to guarantee reproducibility.

This MR also includes options needed to run this setup using a VAE model prepared by the Geant4 collaboration. The preliminary comparison between full and fast simulation can be found below.


Edited by Michal Mazurek

Merge request reports