Skip to content

feat: add leaky_relu(x, alpha=0.01) - #6

Merged
asjad2401 merged 1 commit into
masterfrom
feature/leaky-relu
Aug 1, 2026
Merged

feat: add leaky_relu(x, alpha=0.01)#6
asjad2401 merged 1 commit into
masterfrom
feature/leaky-relu

Conversation

@asjad2401

Copy link
Copy Markdown
Owner

Summary

  • Adds rustnum.leaky_relu(x, alpha=0.01) — first item off the "more activations" roadmap
  • Same FloatElem trait + cast_exact dispatch pattern as relu/sigmoid/softmax
  • 11 new pytest cases (correctness vs NumPy, custom alpha, dtype/shape preservation, int32 rejection)

Test plan

  • cargo build --release — clean
  • maturin develop --release && pytest -q — 49/49 pass

Follows the same FloatElem/cast_exact pattern as relu/sigmoid/softmax.
Adds 11 pytest cases covering correctness, custom alpha, dtype/shape
preservation, and error handling.
@asjad2401
asjad2401 merged commit df90414 into master Aug 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant