{"record":{"id":"b74c5c5dc294f7b7","repo":"tracel-ai/burn","slug":"should-match-at-least-one-parameter-group","errorCode":null,"errorMessage":"Should match at least one parameter group.","messagePattern":"Should match at least one parameter group\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-optim/src/lr_scheduler/module_lr_scheduler.rs","lineNumber":41,"sourceCode":"impl From<LearningRate> for ModuleLearningRate {\n    fn from(value: LearningRate) -> Self {\n        Self {\n            groups: vec![LrGroup {\n                group: ParamGroup::all(),\n                lr: value,\n            }],\n        }\n    }\n}\n\nimpl ModuleLearningRate {\n    /// Get the effective learning rate for the given parameter.\n    pub fn lr_from_param(&self, id: ParamId, path: Option<&str>) -> LearningRate {\n        self.groups\n            .iter()\n            .filter_map(|val| val.group.matches(&id, path).then_some(val.lr))\n            .next_back()\n            .expect(\"Should match at least one parameter group.\")\n    }\n\n    /// Get the base learning rate value which's group matches all parameters.\n    pub fn base(&self) -> LearningRate {\n        self.groups\n            .first()\n            .expect(\"Should have at least one learning rate.\")\n            .lr\n    }\n}\n\n#[derive(Config, Debug)]\nstruct LrSchedulerGroupConfig {\n    group: ParamGroup,\n    scheduler: LrSchedulerConfig,\n}\n\n#[derive(new, Clone)]","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-optim/src/lr_scheduler/module_lr_scheduler.rs#L23-L59","documentation":"Invariant check in `ModuleLearningRate::lr_from_param`: no learning-rate group matched the given parameter id/path, meaning the module LR scheduler was configured without a catch-all group covering this parameter, so lookup panics.","triggerScenarios":"Thrown at crates/burn-optim/src/lr_scheduler/module_lr_scheduler.rs:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a default group matching all parameters (`ParamGroup::all()`) to the ModuleLearningRate","Check the parameter id/path spelling against the configured groups","Ensure the module mapping covers every parameter of the model"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}