You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I just installed Brainpy 2.6.0.post20240618 on Windows 10. The Python version is 3.10.14. To test whether the installation was successful, I used the Hodgkin-Huxley examples offered in the Documentation.
I ran the code successfully and plotted the correct graph. The only regrettable thing was that the progress bar was not displayed and updated as expected, in that it was empty and the level of finish was 0% and 0/1000000 even though the simulation was completed.
I tested the same code on CentOS 7, with the Python and Brainpy versions kept the same. The code was run successfully but still gave an empty progress bar and a zero level of finish.
The code is pasted below for convenience:
importnumpyasnpimportbrainpyasbpimportbrainpy.mathasbmbm.set_platform('cpu')
classHH(bp.dyn.NeuDyn):
def__init__(self, size, ENa=50., gNa=120., EK=-77., gK=36., EL=-54.387, gL=0.03,
V_th=20., C=1.0, **kwargs):
# providing the group "size" informationsuper(HH, self).__init__(size=size, **kwargs)
# initialize parametersself.ENa=ENaself.EK=EKself.EL=ELself.gNa=gNaself.gK=gKself.gL=gLself.C=Cself.V_th=V_th# initialize variablesself.V=bm.Variable(bm.random.randn(self.num) -70.)
self.m=bm.Variable(0.5*bm.ones(self.num))
self.h=bm.Variable(0.6*bm.ones(self.num))
self.n=bm.Variable(0.32*bm.ones(self.num))
self.spike=bm.Variable(bm.zeros(self.num, dtype=bool))
self.t_last_spike=bm.Variable(bm.ones(self.num) *-1e7)
# integral functionsself.int_V=bp.odeint(f=self.dV, method='exp_auto')
self.int_m=bp.odeint(f=self.dm, method='exp_auto')
self.int_h=bp.odeint(f=self.dh, method='exp_auto')
self.int_n=bp.odeint(f=self.dn, method='exp_auto')
defdV(self, V, t, m, h, n, Iext):
I_Na= (self.gNa*m**3.0*h) * (V-self.ENa)
I_K= (self.gK*n**4.0) * (V-self.EK)
I_leak=self.gL* (V-self.EL)
dVdt= (-I_Na-I_K-I_leak+Iext) /self.CreturndVdtdefdm(self, m, t, V):
alpha=0.1* (V+40) / (1-bm.exp(-(V+40) /10))
beta=4.0*bm.exp(-(V+65) /18)
dmdt=alpha* (1-m) -beta*mreturndmdtdefdh(self, h, t, V):
alpha=0.07*bm.exp(-(V+65) /20.)
beta=1/ (1+bm.exp(-(V+35) /10))
dhdt=alpha* (1-h) -beta*hreturndhdtdefdn(self, n, t, V):
alpha=0.01* (V+55) / (1-bm.exp(-(V+55) /10))
beta=0.125*bm.exp(-(V+65) /80)
dndt=alpha* (1-n) -beta*nreturndndtdefupdate(self, x=None):
_t=bp.share['t']
_dt=bp.share['dt']
x=0.ifxisNoneelsex# compute V, m, h, nV=self.int_V(self.V, _t, self.m, self.h, self.n, x, dt=_dt)
self.h.value=self.int_h(self.h, _t, self.V, dt=_dt)
self.m.value=self.int_m(self.m, _t, self.V, dt=_dt)
self.n.value=self.int_n(self.n, _t, self.V, dt=_dt)
# update the spiking state and the last spiking timeself.spike.value=bm.logical_and(self.V<self.V_th, V>=self.V_th)
self.t_last_spike.value=bm.where(self.spike, _t, self.t_last_spike)
# update Vself.V.value=Vneu=HH(10)
runner=bp.DSRunner(neu, monitors=['V'])
inputs=np.ones(int(100000./bm.get_dt())) *6.# 200 msrunner.run(inputs=inputs) # the running time is 200 msbp.visualize.line_plot(runner.mon.ts, runner.mon.V, show=True)
The text was updated successfully, but these errors were encountered:
Thank you for your feedback! We have addressed the issue and created a new Pull Request (#683) to fix the bug. We will merge the changes shortly and prepare to release a new version of BrainPy.
Hi, I just installed Brainpy 2.6.0.post20240618 on Windows 10. The Python version is 3.10.14. To test whether the installation was successful, I used the Hodgkin-Huxley examples offered in the Documentation.
I ran the code successfully and plotted the correct graph. The only regrettable thing was that the progress bar was not displayed and updated as expected, in that it was empty and the level of finish was 0% and 0/1000000 even though the simulation was completed.

I tested the same code on CentOS 7, with the Python and Brainpy versions kept the same. The code was run successfully but still gave an empty progress bar and a zero level of finish.

The code is pasted below for convenience:
The text was updated successfully, but these errors were encountered: