{"record":{"id":"f21caea96c0d8db9","repo":"rohitg00/ai-engineering-from-scratch","slug":"step-log-is-empty","errorCode":null,"errorMessage":"step log is empty","messagePattern":"step log is empty","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phases/19-capstone-projects/44-cosine-lr-warmup/code/main.py","lineNumber":331,"sourceCode":"\n\n@dataclass\nclass StepLogSummary:\n    \"\"\"Reduction of a per-step log to the numbers a reviewer scans first.\"\"\"\n\n    steps: int\n    lr_peak: float\n    lr_final: float\n    grad_l2_peak: float\n    loss_initial: float\n    loss_final: float\n    loss_delta: float\n\n\ndef summarize_step_log(log: Iterable[StepLog]) -> StepLogSummary:\n    rows = list(log)\n    if not rows:\n        raise ValueError(\"step log is empty\")\n    return StepLogSummary(\n        steps=len(rows),\n        lr_peak=max(row.lr for row in rows),\n        lr_final=rows[-1].lr,\n        grad_l2_peak=max(row.grad_l2_norm for row in rows),\n        loss_initial=rows[0].loss,\n        loss_final=rows[-1].loss,\n        loss_delta=rows[-1].loss - rows[0].loss,\n    )\n\n\ndef split_decay_groups(\n    model: nn.Module,\n    weight_decay: float = 0.01,\n    no_decay_names: tuple[str, ...] = (\"bias\", \"LayerNorm.weight\", \"layer_norm.weight\"),\n) -> list[dict[str, object]]:\n    \"\"\"Split model parameters into a decay and a no-decay group.\n","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/19-capstone-projects/44-cosine-lr-warmup/code/main.py#L313-L349","documentation":"Error \"step log is empty\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/19-capstone-projects/44-cosine-lr-warmup/code/main.py:331 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"39ea8a1c6d0b61f071226eff7ede4d4105fed820","analyzedAt":"2026-08-26T03:13:46.626Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}