Skip to content

Conversation

@mhuen
Copy link
Collaborator

@mhuen mhuen commented Feb 26, 2025

Collects all breaking changes for Event-Generator version 2.

Larger changes include:

  • Bugfix for time window exclusions
  • More specific version control of models
  • Shift cascade vertex now part of the model itself
  • Added option to compute DOM angular acceptance as input parameter
  • Overall restructuring of code
  • Mixture models for charge and time PDF via LatentToPDF
  • MPE likelihood added
  • Addition of inf Track Sources and track/cascade Multi-Sources
  • Stabilization of model training and numerical issues
  • Cleanup of v1 configs

mhuen and others added 16 commits May 31, 2024 09:20
* Fix bug: PDF is now renormalized at once at a DOM and not individually for each of the components, which is incorrect and leads to bias

* Update version number to indicate incompatibility with PDF re-normalization prior to bug fix

* Properly re-normalize DOM charge PDF

* Reco viisualization: allow to pass additional kwargs

* Update test data to accomodate change in exclusion handling

* Add version check when loading component

* Add incompatibility check

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
Co-authored-by: mhuen <mhuen@users.noreply.github.com>
* Move shift_cascade_vertex to model; clean up configs; remove float_precision compatibility

* Rename estimate_charge_distribution -> charge_distribution_type

* Update tests

* Add compatibility note

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
* use tfp.math.clip_by_value_preserve_gradient

* Add and scale by angular acceptance

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
Co-authored-by: mhuen <mhuen@users.noreply.github.com>
* use tfp.math.clip_by_value_preserve_gradient

* Add and scale by angular acceptance

* Add relative hole-ice scaling

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
* Use SnowstormParameterDict

* Allow for arbitrary label key name

* Additional verbose timing info

* Add logging level option

* DataInputPipeline: do batch -> event re-formatting in worker node

* Only divide by total charge; update configs

* prevent division by zero

* Unittest: set new parameter event_id_key

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
* Option to evaluate PDF/CDF on individual DOMs

* Merge back branches: LatentToPDF, MPE, Track Sources/Multi-Sources (#41)

* Remove from future import

* Inf tracks sphere (#38)

* Add note on breaking change

* Test EnteringSphereInfTrack

* Mpe likelihood (#32)

* MPE likelihood; option to weight loss terms; cdf values in result_tensors

* Option to limit number of CPU threads

* Streamline epsilon definition; dependent on float_precision

* Force float64 (#31)

* Add dtype argument for casting to basis functions

* Add dtype argument to numpy pdf and cdf functions

* safe_log: clip instead of +eps in log calls

* Cascades: safe log and float64 pdf/cdf evaluation

* Lower bound for sigma and r

* Option to set float precision for pdf cdf evaluation independently

* Turn off normalization by total charge

* Add closest approach point info

* Increase default model size: use reco pulses

* Add one earlier seed point for tracks

* Prevent division by zero

* Add buffer for time window calculation

* Reco speedup: fix data_batch and seed_array for minimizer function

* Speedup: use loss only for jac=False

* Latent to pdf (#37)

* Added LatentToPDFDecoder and AsymmetricGaussianDecoder

* NestedModel: refactor code of MultiSource object to inheret from new base class NestedModel

* Add mixture model

* Add optional decoder to Source and derived classes

* Add value range mapping to decoders

* Refactored load/save mechanism for Model class: recursive; removed uncessesary init

* Set default logger to WARNING

* Gamma Decoder added

* Define t seeds in config rather than in model

* Automatically find packages

* Remove call to time: not really necessary and possibly already  destructed if called via __del__

* Save/Load of Optimizer State (#33)

* Enable save/load of optimizer; Save/load manager like model

* Add training settings as mutable settings to Manager

* use float32 in model, 5 Gamma for tracks

* update configs: float32 is good enough

* Charge pdf (#36)

* Add expectation value to basis functions and decoders

* Poisson and NegativeBinomial decoders; refactor double where trick

* Add support for charge decoders

* Charge PDF: fix calculation of PDF over components

* Restructure compatibility test for charge pdf

* Noise: add multi-component charge PDF

* Inf track: use charge PDF

* Inf track: use charge PDF

* reformat code

* MultiSource models (#35)

Cleans up Multi-Source models. Adds sources and multi-sources for tracks including cascades.

* Inf tracks sphere (#39)

* Add note on breaking change

* Test EnteringSphereInfTrack

* Set missing values in Configuration

* Debug config and model architecture

* Mpe likelihood (#32)

* MPE likelihood; option to weight loss terms; cdf values in result_tensors

* Option to limit number of CPU threads

* Streamline epsilon definition; dependent on float_precision

* Exclude stochastic segment from usage for now

* Remove input signature

* Force float64 (#31)

* Independent precision for loss module

* Set loss precision to float64

* Add dtype argument for casting to basis functions

* Add dtype argument to numpy pdf and cdf functions

* safe_log: clip instead of +eps in log calls

* Cascades: safe log and float64 pdf/cdf evaluation

* Lower bound for sigma and r

* Option to set float precision for pdf cdf evaluation independently

* Turn off normalization by total charge

* Add closest approach point info

* Increase default model size: use reco pulses

* Add one earlier seed point for tracks

* Prevent division by zero

* Add buffer for time window calculation

* Reco speedup: fix data_batch and seed_array for minimizer function

* Speedup: use loss only for jac=False

* Bugfix: fixed dt_geometry due to wrong entry_point

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>

* Latent to pdf (#37)

* Added LatentToPDFDecoder and AsymmetricGaussianDecoder

* NestedModel: refactor code of MultiSource object to inheret from new base class NestedModel

* Add mixture model

* Add optional decoder to Source and derived classes

* Add value range mapping to decoders

* Refactored load/save mechanism for Model class: recursive; removed uncessesary init

* Set default logger to WARNING

* Gamma Decoder added

* Define t seeds in config rather than in model

* Automatically find packages

* Remove call to time: not really necessary and possibly already  destructed if called via __del__

* Save/Load of Optimizer State (#33)

* Enable save/load of optimizer; Save/load manager like model

* Add training settings as mutable settings to Manager

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>

* use float32 in model, 5 Gamma for tracks

* update configs: float32 is good enough

* Charge pdf (#36)

* Add expectation value to basis functions and decoders

* Poisson and NegativeBinomial decoders; refactor double where trick

* Add support for charge decoders

* Charge PDF: fix calculation of PDF over components

* Restructure compatibility test for charge pdf

* Noise: add multi-component charge PDF

* Inf track: use charge PDF

* Inf track: use charge PDF

* reformat code

* MultiSource models (#35)

Cleans up Multi-Source models. Adds sources and multi-sources for tracks including cascades.

* Add note on breaking change (#40)
* Make data trafo object optional (note Manager source still relies on a data_trafo object for parameter tensor)

* Keep track of empty data_trafo in settings

* Allow top-level not to have a data_trafo, check nested sub_components instead

* Recursively check all data_handlers in sub components

* Remove updating of data transformer

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2025

Codecov Report

Attention: Patch coverage is 21.05263% with 240 lines in your changes missing coverage. Please review.

Project coverage is 26.32%. Comparing base (2eaa6f7) to head (650af44).
Report is 280 commits behind head on master.

Files with missing lines Patch % Lines
egenerator/loss/default.py 6.32% 74 Missing ⚠️
...addons/sphere_inf_track/sphere_inf_track_seeder.py 0.00% 47 Missing ⚠️
egenerator/data/handler/base.py 2.56% 38 Missing ⚠️
egenerator/data/modules/labels/general.py 50.00% 19 Missing and 1 partial ⚠️
egenerator/data/modules/data/pulse_data.py 53.12% 14 Missing and 1 partial ⚠️
egenerator/ic3/visualization.py 0.00% 11 Missing ⚠️
...les/labels/snowstorm_track_equidistant_cascades.py 0.00% 9 Missing ⚠️
egenerator/ic3/simulation.py 0.00% 9 Missing ⚠️
egenerator/export_manager.py 0.00% 4 Missing ⚠️
egenerator/ic3/reconstruction.py 0.00% 4 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
+ Coverage   25.77%   26.32%   +0.55%     
==========================================
  Files          56       92      +36     
  Lines        5223     9941    +4718     
  Branches      866     1770     +904     
==========================================
+ Hits         1346     2617    +1271     
- Misses       3819     7154    +3335     
- Partials       58      170     +112     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mhuen mhuen marked this pull request as ready for review March 10, 2025 17:21
@mhuen mhuen merged commit ed0b766 into master Mar 10, 2025
4 checks passed
@mhuen mhuen deleted the CollectBreakingChanges branch March 10, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants