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

Doc for brainpylib>=0.3.0 #645

Merged
merged 4 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .github/workflows/docs.yml

This file was deleted.

2,663 changes: 2,663 additions & 0 deletions brainpy-changelog.md

Large diffs are not rendered by default.

31 changes: 28 additions & 3 deletions brainpy/_src/dyn/neurons/hh.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ def __init__(
m_initializer: Optional[Union[Callable, ArrayType]] = None,
h_initializer: Optional[Union[Callable, ArrayType]] = None,
n_initializer: Optional[Union[Callable, ArrayType]] = None,

# noise
noise: Union[float, ArrayType, Callable] = None,
):
# initialization
super().__init__(size=size,
Expand All @@ -340,8 +343,14 @@ def __init__(
self._n_initializer = is_initializer(n_initializer, allow_none=True)
self._V_initializer = is_initializer(V_initializer)

# noise
self.noise = init_noise(noise, self.varshape, num_vars=4)

# integral
self.integral = odeint(method=method, f=self.derivative)
if self.noise is None:
self.integral = odeint(method=method, f=self.derivative)
else:
self.integral = sdeint(method=self.method, f=self.derivative, g=self.noise)

# model
if init_var:
Expand Down Expand Up @@ -622,6 +631,9 @@ def __init__(
V_th: Union[float, ArrayType, Callable] = 10.,
W_initializer: Union[Callable, ArrayType] = OneInit(0.02),
V_initializer: Union[Callable, ArrayType] = Uniform(-70., -60.),

# noise
noise: Union[float, ArrayType, Callable] = None,
):
# initialization
super().__init__(size=size,
Expand Down Expand Up @@ -650,8 +662,13 @@ def __init__(
self._W_initializer = is_initializer(W_initializer)
self._V_initializer = is_initializer(V_initializer)

# noise
self.noise = init_noise(noise, self.varshape, num_vars=2)
# integral
self.integral = odeint(method=method, f=self.derivative)
if self.noise is not None:
self.integral = sdeint(method=self.method, f=self.derivative, g=self.noise)
else:
self.integral = odeint(method=method, f=self.derivative)

# model
if init_var:
Expand Down Expand Up @@ -895,6 +912,9 @@ def __init__(
V_initializer: Union[Callable, ArrayType] = OneInit(-65.),
h_initializer: Union[Callable, ArrayType] = OneInit(0.6),
n_initializer: Union[Callable, ArrayType] = OneInit(0.32),

# noise
noise: Union[float, ArrayType, Callable] = None,
):
# initialization
super().__init__(size=size,
Expand All @@ -920,8 +940,13 @@ def __init__(
self._n_initializer = is_initializer(n_initializer)
self._V_initializer = is_initializer(V_initializer)

# noise
self.noise = init_noise(noise, self.varshape, num_vars=3)
# integral
self.integral = odeint(method=method, f=self.derivative)
if self.noise is not None:
self.integral = sdeint(method=self.method, f=self.derivative, g=self.noise)
else:
self.integral = odeint(method=method, f=self.derivative)

# model
if init_var:
Expand Down
Loading
Loading