-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cleans up Multi-Source models. Adds sources and multi-sources for tracks including cascades.