{"record":{"id":"6d64d04aec450dec","repo":"keras-team/keras","slug":"invalid-value-received-for-argument-rate-expect-6d64d0","errorCode":null,"errorMessage":"Invalid value received for argument `rate`. Expected a float value between 0 and 1. Received: rate={rate}","messagePattern":"Invalid value received for argument `rate`\\. Expected a float value between 0 and 1\\. Received: rate=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/regularization/dropout.py","lineNumber":44,"sourceCode":"        rate: Float between 0 and 1. Fraction of the input units to drop.\n        noise_shape: 1D integer tensor representing the shape of the\n            binary dropout mask that will be multiplied with the input.\n            For instance, if your inputs have shape\n            `(batch_size, timesteps, features)` and\n            you want the dropout mask to be the same for all timesteps,\n            you can use `noise_shape=(batch_size, 1, features)`.\n        seed: A Python integer to use as random seed.\n\n    Call arguments:\n        inputs: Input tensor (of any rank).\n        training: Python boolean indicating whether the layer should behave in\n            training mode (adding dropout) or in inference mode (doing nothing).\n    \"\"\"\n\n    def __init__(self, rate, noise_shape=None, seed=None, **kwargs):\n        super().__init__(**kwargs)\n        if not 0 <= rate <= 1:\n            raise ValueError(\n                f\"Invalid value received for argument \"\n                \"`rate`. Expected a float value between 0 and 1. \"\n                f\"Received: rate={rate}\"\n            )\n        self.rate = rate\n        self.seed = seed\n        self.noise_shape = self._validate_noise_shape(noise_shape)\n        if rate > 0:\n            self.seed_generator = backend.random.SeedGenerator(seed)\n        self.supports_masking = True\n\n        self._build_at_init()\n\n    def _validate_noise_shape(self, noise_shape):\n        if noise_shape is None:\n            return None\n\n        if isinstance(noise_shape, str):","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/regularization/dropout.py#L26-L62","documentation":"Error \"Invalid value received for argument `rate`. Expected a float value between 0 and 1. Received: rate={rate}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/regularization/dropout.py:44 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":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}