Skip to content

Remove gate_activation to allow pickling#1694

Merged
michaeldeistler merged 1 commit intomainfrom
removegateactivation
Nov 6, 2025
Merged

Remove gate_activation to allow pickling#1694
michaeldeistler merged 1 commit intomainfrom
removegateactivation

Conversation

@michaeldeistler
Copy link
Contributor

@michaeldeistler michaeldeistler commented Nov 6, 2025

Closes #1690

The lambda in the gate_activation leads to a pickling error. We could work around this, but I think it is really a niche feature and I would simply remove the option to modify the gate_activation.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.62%. Comparing base (f2fd1ab) to head (3217e5e).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1694      +/-   ##
==========================================
- Coverage   88.48%   84.62%   -3.86%     
==========================================
  Files         137      137              
  Lines       11473    11470       -3     
==========================================
- Hits        10152     9707     -445     
- Misses       1321     1763     +442     
Flag Coverage Δ
unittests 84.62% <100.00%> (-3.86%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sbi/neural_nets/net_builders/vector_field_nets.py 92.54% <100.00%> (-0.69%) ⬇️

... and 27 files with indirect coverage changes

Copy link
Contributor

@manuelgloeckler manuelgloeckler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, fine with that.

A slightly more general approach would be to replace the lambda with an function i.e. def default_gate_activation on a global namespace and then default to this. This should be pickable.

@michaeldeistler michaeldeistler merged commit 6ffe7b6 into main Nov 6, 2025
9 checks passed
@michaeldeistler michaeldeistler deleted the removegateactivation branch November 6, 2025 13:51
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.

NPSE with transformers cannot be pickled

3 participants