Skip to content

Dropout scaling can overflow for p values close to 1 #38

Description

@github-actions

File: leanpass/nn.py

Dropout.forward scales the mask by 1/(1-p). When p is very close to 1 (e.g., 0.9999) the scaling factor becomes huge, leading to overflow or exploding activations.

Fix: enforce a stricter upper bound (e.g., p <= 0.9) or use a numerically stable inverted‑dropout implementation that caps the scaling factor.

Label: bug

Filed automatically by ai-issue-scan.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions