-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from PKU-NIP-Lab/whole-brain-modeling
fix bugs
- Loading branch information
Showing
52 changed files
with
838 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
__all__ = [ | ||
'is_checking', | ||
'turn_on', | ||
'turn_off', | ||
] | ||
|
||
_check = True | ||
|
||
|
||
def is_checking(): | ||
"""Whether the checking is turn on.""" | ||
return _check | ||
|
||
|
||
def turn_on(): | ||
"""Turn on the checking.""" | ||
global _check | ||
_check = True | ||
|
||
|
||
def turn_off(): | ||
"""Turn off the checking.""" | ||
global _check | ||
_check = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from .base import * | ||
from .fhn import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from brainpy.dyn.base import DynamicalSystem | ||
from brainpy.tools.others import to_size, size2num | ||
from brainpy.types import Shape | ||
|
||
__all__ = [ | ||
'RateModel', | ||
] | ||
|
||
|
||
class RateModel(DynamicalSystem): | ||
"""Base class of rate models.""" | ||
|
||
def __init__(self, | ||
size: Shape, | ||
name: str = None): | ||
super(RateModel, self).__init__(name=name) | ||
|
||
self.size = to_size(size) | ||
self.num = size2num(self.size) | ||
|
||
def update(self, _t, _dt): | ||
"""The function to specify the updating rule. | ||
Parameters | ||
---------- | ||
_t : float | ||
The current time. | ||
_dt : float | ||
The time step. | ||
""" | ||
raise NotImplementedError(f'Subclass of {self.__class__.__name__} must ' | ||
f'implement "update" function.') |
Oops, something went wrong.