{"record":{"id":"50be02d0b224677d","repo":"huggingface/pytorch-image-models","slug":"invalid-epsilon-value-50be02","errorCode":null,"errorMessage":"Invalid epsilon value: {}","messagePattern":"Invalid epsilon value: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"timm/optim/adan.py","lineNumber":76,"sourceCode":"        no_prox: How to perform the weight decay\n        caution: Enable caution from 'Cautious Optimizers'\n        foreach: If True would use torch._foreach implementation. Faster but uses slightly more memory.\n    \"\"\"\n\n    def __init__(self,\n            params,\n            lr: float = 1e-3,\n            betas: Tuple[float, float, float] = (0.98, 0.92, 0.99),\n            eps: float = 1e-8,\n            weight_decay: float = 0.0,\n            no_prox: bool = False,\n            caution: bool = False,\n            foreach: Optional[bool] = None,\n    ):\n        if not 0.0 <= lr:\n            raise ValueError('Invalid learning rate: {}'.format(lr))\n        if not 0.0 <= eps:\n            raise ValueError('Invalid epsilon value: {}'.format(eps))\n        if not 0.0 <= betas[0] < 1.0:\n            raise ValueError('Invalid beta parameter at index 0: {}'.format(betas[0]))\n        if not 0.0 <= betas[1] < 1.0:\n            raise ValueError('Invalid beta parameter at index 1: {}'.format(betas[1]))\n        if not 0.0 <= betas[2] < 1.0:\n            raise ValueError('Invalid beta parameter at index 2: {}'.format(betas[2]))\n\n        defaults = dict(\n            lr=lr,\n            betas=betas,\n            eps=eps,\n            weight_decay=weight_decay,\n            no_prox=no_prox,\n            caution=caution,\n            foreach=foreach,\n        )\n        super().__init__(params, defaults)\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/huggingface/pytorch-image-models/blob/9a5261e31b3b5128526eb2658333b4c0a54464ae/timm/optim/adan.py#L58-L94","documentation":"Raised by timm's Adan optimizer constructor when eps is negative. eps is the numerical-stability term added to denominators, so it must be >= 0.","triggerScenarios":"Calling timm.optim.Adan(params, eps=value) with value < 0.0.","commonSituations":"Typo in config (eps: -1e-8), or accidentally binding another hyperparameter's value into eps during a sweep.","solutions":["Use a small non-negative eps, typically 1e-8","Check the config/CLI mapping that produced the negative eps"],"exampleFix":"# before\nopt = timm.optim.Adan(model.parameters(), lr=1e-3, eps=-1e-8)\n# after\nopt = timm.optim.Adan(model.parameters(), lr=1e-3, eps=1e-8)","handlingStrategy":"validation","validationCode":"assert eps >= 0.0, f'eps must be >= 0, got {eps}'","typeGuard":"def valid_eps(eps) -> bool:\n    return isinstance(eps, (int, float)) and eps >= 0.0","tryCatchPattern":null,"preventionTips":["Default eps to 1e-8 and only override deliberately","Validate all optimizer scalars in one helper"],"tags":["optimizer","adan","hyperparameters","validation"],"backgroundTag":"optimizer-hyperparameter-out-of-range","analyzedSha":"9a5261e31b3b5128526eb2658333b4c0a54464ae","analyzedAt":"2026-08-27T02:34:25.417Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}