Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiSource models #35

Merged
merged 5 commits into from
Feb 26, 2025
Merged

MultiSource models #35

merged 5 commits into from
Feb 26, 2025

Conversation

mhuen
Copy link
Collaborator

@mhuen mhuen commented Feb 26, 2025

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

mhuen and others added 5 commits January 15, 2025 12:02
Adds a source definition of a track and embedded cascades EnteringSphereInfTrackMultiCascade, as well as variable cascade model along a track. Adds (untested) quantile loss
@mhuen mhuen merged commit cad8abf into ChargePDF Feb 26, 2025
0 of 4 checks passed
@mhuen mhuen deleted the MultiTrack branch February 26, 2025 18:05
mhuen added a commit that referenced this pull request Feb 26, 2025
* 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.

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
mhuen added a commit that referenced this pull request Feb 26, 2025
* 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.

---------

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

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
mhuen added a commit that referenced this pull request Feb 26, 2025
* 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
---------

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.

---------

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

---------

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

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
mhuen added a commit that referenced this pull request Feb 26, 2025
* 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.

---------

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

---------

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

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
mhuen added a commit that referenced this pull request Feb 26, 2025
* Remove duplicated code

* Update tests

* 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
---------

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.

---------

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

---------

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

---------

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

* 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.

---------

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

---------

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

---------

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

* Add note on breaking change (#40)

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

---------

Co-authored-by: mhuen <mhuen@users.noreply.github.com>
mhuen added a commit that referenced this pull request Feb 26, 2025
* 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)
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.

1 participant