Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
84d6ee2
Move name and epsilon to Model base class
mhuen Nov 5, 2024
4b1b955
Move parameter_names and indexing to Model base class; fix tests
mhuen Nov 5, 2024
482583a
Added LatentToPDFDecoder and AsymmetricGaussianDecoder
mhuen Nov 5, 2024
72d0ebe
NestedModel: refactor code of MultiSource object to inheret from new …
mhuen Nov 5, 2024
1a64cf0
MixtureModel: initial commit. Many todos - not functional yet
mhuen Nov 5, 2024
013d41d
Add mixture model
mhuen Nov 6, 2024
bdb8613
Add mixture model: reformat
mhuen Nov 6, 2024
38ed26b
Add mixture model: fix epsilon
mhuen Nov 6, 2024
931110a
Add mixture model: fix epsilon
mhuen Nov 6, 2024
e24d034
Add optional decoder to Source and derived classes
mhuen Nov 7, 2024
57a3ba4
Add value range mapping to decoders
mhuen Nov 7, 2024
ea6c1ea
Add value range mapping to decoders: fix tests
mhuen Nov 7, 2024
eaeaf9e
rename num_parameters to n_parameters
mhuen Nov 7, 2024
7d3102c
Allow per_component evaluation of MixtureModel
mhuen Nov 7, 2024
bbbcc0d
Minor change in properties of decoder
mhuen Nov 8, 2024
b233448
Use LatentToPDF MixtureModel: initial commit
mhuen Nov 8, 2024
0f70a76
Use LatentToPDF MixtureModel: fix shape mismatch in noise model
mhuen Nov 8, 2024
d3fd992
Refactored load/save mechanism for Model class: recursive; removed un…
mhuen Nov 10, 2024
f3fa189
Set default logger to WARNING
mhuen Nov 10, 2024
8aca1e6
numpy pdf/cdf evaluation: fix shapes
mhuen Nov 10, 2024
74db663
Gamma Decoder added
mhuen Nov 11, 2024
35a5282
Gamma: test mixture
mhuen Nov 11, 2024
7f42429
Gamma: test mixture
mhuen Nov 11, 2024
e23610e
Gamma: use nested where to avoid nan gradients
mhuen Nov 11, 2024
572d848
Gamma: use nested where to avoid nan gradients
mhuen Nov 11, 2024
d6e4c93
Safe cdf clip in LatentToPDF
mhuen Nov 12, 2024
a428dd8
MixtureModel: assert weights >= 0
mhuen Nov 12, 2024
53e2af3
MixtureModel: bugfix in slice of second mixture component
mhuen Nov 12, 2024
b77fdb3
MixtureModel: add weight factor between components
mhuen Nov 12, 2024
fdc707d
MixtureModel: add weight factor between components
mhuen Nov 12, 2024
c3b9e7e
Fix typo: use base_name
mhuen Nov 12, 2024
7e6cec8
MixtureModel weight factor: fix bug
mhuen Nov 12, 2024
432b59b
Define t seeds in config rather than in model
mhuen Nov 13, 2024
a038c54
Define t seeds in config rather than in model: typo
mhuen Nov 13, 2024
075a726
Update utilized mixture model
mhuen Nov 13, 2024
039eadc
Automatically find packages
mhuen Nov 22, 2024
0b946b9
Safety check in clip_logits; safely clip weights
mhuen Dec 2, 2024
e5b28d3
Enforce energy >= 0
mhuen Dec 2, 2024
c0dbcaa
Fix dimension of dom_cdf_exclusion
mhuen Dec 4, 2024
010da6e
Fix dimension of dom_cdf_exclusion
mhuen Dec 4, 2024
93345b2
Fix dimension of dom_cdf_exclusion
mhuen Dec 4, 2024
92d8e2b
Set float precision for boundaries
mhuen Dec 4, 2024
836af3c
Set float precision for boundaries
mhuen Dec 4, 2024
eed12c8
Set float precision for boundaries
mhuen Dec 4, 2024
4ab57c2
Add I3Particle converter
mhuen Dec 5, 2024
3a0d91a
Add I3Particle converter
mhuen Dec 5, 2024
c044a56
Add I3Particle converter
mhuen Dec 5, 2024
9b46d8f
Update cascade config
mhuen Dec 9, 2024
2f69b59
Fix typo
mhuen Dec 10, 2024
de36e13
fix shape of cascade time
mhuen Dec 12, 2024
2cd58d1
Limit energy
mhuen Dec 17, 2024
ff0b059
Update cascade config: rever back to smaller size, SPE+DOMCHarge pdf
mhuen Dec 17, 2024
67de1a5
Track reco
mhuen Dec 18, 2024
59226a4
Remove call to time: not really necessary and possibly already destr…
mhuen Dec 18, 2024
e93b142
Save/Load of Optimizer State (#33)
mhuen Dec 19, 2024
29d9416
use float32 in model, 5 Gamma for tracks
mhuen Dec 28, 2024
5b29ffb
update configs: float32 is good enough
mhuen Jan 9, 2025
5a41287
Charge pdf (#36)
mhuen Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
262 changes: 224 additions & 38 deletions configs/cascade_11param_noise_ftpv3m.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ loss_module_settings: [

config: {
# the float precision to use
'float_precision': 'float64',
'float_precision': 'float32',
# Add normalization terms to llh if True
'add_normalization_term': True,
# choose the loss function to use
Expand All @@ -295,49 +295,35 @@ loss_module_settings: [

config: {
# the float precision to use
'float_precision': 'float64',
'float_precision': 'float32',
# Add normalization terms to llh if True
'add_normalization_term': True,
# choose the loss function to use
'loss_function_name': 'normalized_dom_charge_pdf',
},
},
{
# The loss module class to use
'loss_module': 'egenerator.loss.default.DefaultLossModule',
'loss_module_weight': 1.0,

config: {
# the float precision to use
'float_precision': 'float64',
# Add normalization terms to llh if True
'add_normalization_term': True,
# choose the loss function to use
'loss_function_name': 'negative_binomial_charge_pdf',
},
},
{
# The loss module class to use
'loss_module': 'egenerator.loss.default.DefaultLossModule',
'loss_module_weight': 1.0,

config: {
# the float precision to use
'float_precision': 'float64',
# Add normalization terms to llh if True
'add_normalization_term': True,
# choose the loss function to use
'loss_function_name': 'negative_binomial_event_charge_pdf',
'loss_function_name': 'dom_charge_pdf',
},
},
# {
# # The loss module class to use
# 'loss_module': 'egenerator.loss.default.DefaultLossModule',
# 'loss_module_weight': 1.0,

# config: {
# # the float precision to use
# 'float_precision': 'float32',
# # Add normalization terms to llh if True
# 'add_normalization_term': True,
# # choose the loss function to use
# 'loss_function_name': 'negative_binomial_charge_pdf',
# },
# },
{
# The loss module class to use
'loss_module': 'egenerator.loss.snowstorm.SnowstormPriorLossModule',
'loss_module_weight': 1.0,

config: {
# the float precision to use
'float_precision': 'float64',
'float_precision': 'float32',
# define uniform priors
'uniform_parameters': {
'cascade_Absorption': [0.913, 1.087],
Expand Down Expand Up @@ -470,6 +456,7 @@ model_settings: {

# configuration settings for DefaultMultiCascadeModel object
config: {
'float_precision': float32,
'sources': {
'noise': 'noise',
'cascade': 'cascade',
Expand All @@ -482,7 +469,77 @@ model_settings: {
noise: {
# The noise source model class to use
'model_class': 'egenerator.model.source.noise.default.DefaultNoiseModel',
config: {'float_precision': float32},

config: {
'float_precision': float32,
'num_local_vars': 9,

# define names of charge latent vars that should be
# scaled internally by the model (e.g. by the energy, eff.)
# Note: the decoder should not add additional value
# range mapping for these tensors!
'charge_scale_tensors': [
"NegativeBinomial_mu_000",
"NegativeBinomial_mu_001",
"NegativeBinomial_mu_002",
],
},

# configuration for the charge decoder to transform the latent
# variables to the expected charge PDF.
decoder_charge_settings: {

# The decoder class to use
decoder_class: "egenerator.model.decoder.mixture.MixtureModel",

# configuration of the mixture model
config: {
# Note that mapping here will just repeat the names,
# but in other cases it could be used to reuse the
# same base model multiple times (as for MultiSource objects)
"decoder_mapping": {
"NegativeBinomial": ["NegativeBinomial", 3, 1.0],
},

# Define a mapping of latent variable to value range functions
"value_range_mapping": {
"weight": {
"value_range_class": "egenerator.utils.value_range.EluValueRange",
"config": {
"scale": 1.0,
"offset": 1.0,
"min_value": 0.000001
},
},
},
},

# Define the decoder types that are used as components of the mixture
# model
base_decoders: {
"NegativeBinomial": {
# The decoder class to use
decoder_class: "egenerator.model.decoder.NegativeBinomialDecoder",

# configuration of the negative binomial model
'config': {
'float_precision': float32,

# Define a mapping of latent variable to value range functions
"value_range_mapping": {
"alpha": {
"value_range_class": "egenerator.utils.value_range.EluValueRange",
"config": {
"scale": 1.0,
"offset": -5.0,
"min_value": 0.0001,
},
},
},
},
},
},
},
},

cascade: {
Expand All @@ -502,11 +559,14 @@ model_settings: {
'scale_charge_by_global_dom_efficiency': False,
'scale_charge_by_angular_acceptance': True,
'scale_charge_by_relative_angular_acceptance': False,
'prevent_mixture_component_swapping': False,
'charge_distribution_type': 'negative_binomial',
'num_latent_models': 10,
'float_precision': float32,
'float_precision_pdf_cdf': float64,
'mixture_component_t_seeds': [0, -100, 100, 8000, 4000, 800, 300, -50, -20, -10, -5, 0],

# define names of charge latent vars that should be
# scaled internally by the model (e.g. by the energy, eff.)
# Note: the decoder should not add additional value
# range mapping for these tensors!
'charge_scale_tensors': ["mu"],

# Baseline DOM Angular acceptance
'use_constant_baseline_hole_ice': False,
Expand All @@ -527,7 +587,7 @@ model_settings: {

# First convolutions
'filter_size_list' : [[1, 1], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1]],
'num_filters_list' : [25, 100, 100, 100, 100, 42],
'num_filters_list' : [50, 100, 100, 100, 100, 45],
'method_list' : ['locally_connected',
'convolution', 'convolution', 'convolution',
'convolution', 'convolution',
Expand All @@ -537,6 +597,132 @@ model_settings: {
'use_batch_norm_list' : False,
'use_residual_list' : [True, True, True, True, True, False]
},

# configuration for the charge decoder to transform the latent
# variables to the expected charge PDF.
decoder_charge_settings: {
# The decoder class to use
decoder_class: "egenerator.model.decoder.NegativeBinomialDecoder",

# configuration of the negative binomial model
'config': {
'float_precision': float32,

# Define a mapping of latent variable to value range functions
"value_range_mapping": {
"alpha": {
"value_range_class": "egenerator.utils.value_range.EluValueRange",
"config": {
"scale": 1.0,
"offset": -5.0,
"min_value": 0.0001,
},
},
},
},
},

# configuration of the decoder to transform the latent variables
# to the time arrival PDF
decoder_settings: {

# The decoder class to use
decoder_class: "egenerator.model.decoder.mixture.MixtureModel",

# configuration of the mixture model
config: {
# Note that mapping here will just repeat the names,
# but in other cases it could be used to reuse the
# same base model multiple times (as for MultiSource objects)
"decoder_mapping": {
"AssymetricGaussian": ["AssymetricGaussian", 7, 1.0],
"GammaFunction": ["GammaFunction", 5, 10.0],
},

# Define a mapping of latent variable to value range functions
"value_range_mapping": {
"weight": {
"value_range_class": "egenerator.utils.value_range.EluValueRange",
"config": {
"scale": 1.0,
"offset": 1.0,
"min_value": 0.00001
},
},
},
},

# Define the decoder types that are used as components of the mixture
# model
base_decoders: {
AssymetricGaussian: {
'decoder_class': 'egenerator.model.decoder.AsymmetricGaussianDecoder',
'config': {
'float_precision': float32,

# Define a mapping of latent variable to value range functions
"value_range_mapping": {
"mu": {
"value_range_class": "egenerator.utils.value_range.BaseValueRange",
"config": {
"scale": 0.5,
"offset": 0.0,
},
},
"sigma": {
"value_range_class": "egenerator.utils.value_range.EluValueRange",
"config": {
"scale": 1.0,
"offset": 2.0,
"min_value": 0.0001,
},
},
"r": {
"value_range_class": "egenerator.utils.value_range.EluValueRange",
"config": {
"scale": 1.0,
"offset": 1.0,
"min_value": 0.0001,
},
},
},
},

# Define load_dir here if you want to load the model from a file
# This does not make sense for a paremeter-less model, but it
# could be used for a model that has been trained and saved
# previously such as a normalizing flow model.
# 'load_dir': 'path/to/model',
},
GammaFunction: {
'decoder_class': 'egenerator.model.decoder.GammaFunctionDecoder',
'config': {
'float_precision': float32,
'offset': 0.0, # note that offset is in model time units

# Define a mapping of latent variable to value range functions
"value_range_mapping": {
"alpha": {
"value_range_class": "egenerator.utils.value_range.EluValueRange",
"config": {
"scale": 0.3,
"offset": 2.5,
"min_value": 0.5,
},
},
"beta": {
"value_range_class": "egenerator.utils.value_range.EluValueRange",
"config": {
"scale": 1.0,
"offset": 10.0,
"min_value": 1.0,
},
},
},
},
},
},
},
},
},
}
Expand Down
Loading
Loading