Background réaliste CsI(Tl) + hybridation mesuré/synthétique + dashboard continuum
- Remplace le continuum exponentiel par un modèle réaliste CsI(Tl) dans l'entraînement (bosse asymétrique ~110 keV + queue Compton) - Ajoute l'injection de background mesuré (70% mesuré / 30% synthétique) via --measured_background et MEASURED_BACKGROUND_PATH - Ajoute l'endpoint /api/background/continuum et le toggle "Continuum CsI" sur le dashboard background - Exclut le canal 1023 (overflow bin) de l'affichage web (NUM_CHANNELS=1023) - Corrige le lissage Gaussien du background (normalisation locale aux bords) - Met à jour README.md, CLAUDE.md, TUTORIEL.md, TOTO.md, vega_ml/README.md Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@ -136,6 +136,7 @@ def generate_training_batch(
|
||||
background_only_fraction: float = 0.1,
|
||||
save_png: bool = False,
|
||||
random_seed: int = None,
|
||||
measured_background_path: str = None,
|
||||
) -> list:
|
||||
"""
|
||||
Generate a batch of training samples with various configurations.
|
||||
@ -210,6 +211,7 @@ def generate_training_batch(
|
||||
duration,
|
||||
detector_name=detector_name,
|
||||
include_background=True,
|
||||
measured_background_path=measured_background_path,
|
||||
)
|
||||
|
||||
# Save spectrum (don't accumulate in memory)
|
||||
@ -240,6 +242,7 @@ def generate_training_batch(
|
||||
duration,
|
||||
detector_name=detector_name,
|
||||
include_background=True,
|
||||
measured_background_path=measured_background_path,
|
||||
)
|
||||
|
||||
save_spectrum(
|
||||
@ -270,6 +273,7 @@ def generate_training_batch(
|
||||
duration,
|
||||
detector_name=detector_name,
|
||||
include_background=True,
|
||||
measured_background_path=measured_background_path,
|
||||
)
|
||||
|
||||
save_spectrum(
|
||||
@ -295,6 +299,7 @@ def generate_training_batch(
|
||||
sources=[], # No additional sources
|
||||
include_background=True,
|
||||
detector_name=detector_name,
|
||||
measured_background_path=measured_background_path,
|
||||
)
|
||||
|
||||
spectrum = generator.generate_spectrum(config)
|
||||
@ -367,6 +372,13 @@ def main():
|
||||
default=100.0,
|
||||
help="Maximum source activity in Bq (default: 100.0)"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--measured_background",
|
||||
type=str,
|
||||
default=None,
|
||||
help="Path to measured background .npy file for hybrid training"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--save_png",
|
||||
@ -402,6 +414,7 @@ def main():
|
||||
activity_range=(args.min_activity, args.max_activity),
|
||||
save_png=args.save_png,
|
||||
random_seed=args.seed,
|
||||
measured_background_path=args.measured_background,
|
||||
)
|
||||
|
||||
print("\n" + "=" * 60)
|
||||
|
||||
Reference in New Issue
Block a user