Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

softplus transform does not properly rescale parameters #343

Closed
michaeldeistler opened this issue Apr 16, 2024 · 1 comment · Fixed by #456
Closed

softplus transform does not properly rescale parameters #343

michaeldeistler opened this issue Apr 16, 2024 · 1 comment · Fixed by #456
Assignees
Labels
enhancement New feature or request good second issue Can be done without knowing the ins and outs of Jaxley, but probably not suited fo newcomers.

Comments

@michaeldeistler
Copy link
Contributor

michaeldeistler commented Apr 16, 2024

Problem

The ParamTransform transforms params to be unbounded and (as a nice side effect) roughly z-scores them. However, if one an upper or lower bound are passed, then it does not z-score.

Solution

We should generally find a good solution to z-score bounded, unbounded, and half-bounded parameters.

Maybe sth like the following:

tf: Dict = {}

# Some parameters are bounded from both sides.
tf = tf | {"HH_gNa": jx.SigmoidTransform(lower=0.0, upper=2.0)}
tf = tf | {"HH_gK": jx.SigmoidTransform(lower=0.0, upper=1.0)}

# Some parameters are bounded from above.
tf = tf | {"length": jx.SoftplusTransform(upper=100.0, scale=30.0)}

# Some parameters are bounded from below.
tf = tf | {"radius": jx.SoftplusTransform(lower=0.0, scale=6.0)}

# Some parameters are unbounded but should be z-scored.
tf = tf | {"IonotropicSynapse_gS": jx.AffineTransform(scale=5.0, offset=2.0)}

transform = jx.ParamTransform(tf)

# Apply transform
params = net.get_parameters()
opt_params = transform.inverse(params)
@michaeldeistler michaeldeistler added the enhancement New feature or request label Apr 16, 2024
@michaeldeistler michaeldeistler added the good second issue Can be done without knowing the ins and outs of Jaxley, but probably not suited fo newcomers. label Oct 23, 2024
@michaeldeistler
Copy link
Contributor Author

@manuelgloeckler you might be interested in this?

@manuelgloeckler manuelgloeckler self-assigned this Oct 23, 2024
@manuelgloeckler manuelgloeckler linked a pull request Oct 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good second issue Can be done without knowing the ins and outs of Jaxley, but probably not suited fo newcomers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants