-
Notifications
You must be signed in to change notification settings - Fork 12
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
WIP: Allow vectors to be used with .data_set()
#574
base: main
Are you sure you want to change the base?
Conversation
Also while working on this I realized the the regular net = SimpleNet(2, 2, 4)
net.set("radius", np.repeat(1.0, 16)) # no error
net.cell(range(2)).set("radius", np.repeat(1.0, 16)) # no error, which is very weird!
net.cell(range(2)).set("radius", np.repeat(1.0, 2)) # error, which should pass I've included tests for this which is why the PR is failing, they should pass if I limit the tests to just the I may need some guidance on where to look to proceed. I imagine this is possible since |
Hi Nick! Thanks for the PR! I think net = SimpleNet(2, 2, 4) creates a net of two neurons with 2 branches each, and each branch having 4 compartments. This makes a total of 16 compartments. Then, I agree that it would be nice to support the second line. It's definitely possible, but it would require extra logic for the That being said: since we currently do not support this yet, please remove the test. I agree that there is something off with |
Will do! Also I spoke to soon, this does indeed break a few things, I'll keep at it... |
Yes, I also just found a small example that breaks after the change: import jaxley as jx
import numpy as np
from jaxley.channels import Na
comp = jx.Compartment()
branch = jx.Branch(comp, ncomp=4)
cell1 = jx.Cell(branch, parents=[-1])
cell2 = jx.Cell(branch, parents=[-1, 0, 0])
net = jx.Network([cell1, cell2])
net.cell("all").make_trainable("radius")
params = net.get_parameters()
net.record('v')
s = jx.integrate(net, t_max=10, params=params) I think the best place to fix it would be here, but it requires quite a bit of logic: If the number of compartments matches the number of values, then See this comment which explains how |
Closes #573. Only change is swapping the dimensions when squeezing the
params
used for the.set()
@michaeldeistler @jnsbck is there anything I'm missing? Hopefully this isn't breaking something somewhere else!