-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[math & dyn] add
brainpy.math.exprel
, and change the code in the …
…corresponding HH neuron models to improve numerical computation accuracy (#557) * merge (#6) * [running] fix multiprocessing bugs (#547) * [running] fix multiprocessing bugs * fix tests * [docs] Fix typo in docs (#549) * ⬆️ Bump conda-incubator/setup-miniconda from 2 to 3 (#551) Bumps [conda-incubator/setup-miniconda](https://github.com/conda-incubator/setup-miniconda) from 2 to 3. - [Release notes](https://github.com/conda-incubator/setup-miniconda/releases) - [Changelog](https://github.com/conda-incubator/setup-miniconda/blob/main/CHANGELOG.md) - [Commits](conda-incubator/setup-miniconda@v2...v3) --- updated-dependencies: - dependency-name: conda-incubator/setup-miniconda dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * updates (#550) * [running] fix multiprocessing bugs * fix tests * [doc] update doc * update * [math] add `brainpy.math.gpu_memory_preallocation()` for controlling GPU memory preallocation * [math] `clear_buffer_memory` support to clear array and compilation both * [dyn] compatible old version of `.reset_state()` function * [setup] update installation info * ``brainpy.math.defjvp`` and ``brainpy.math.XLACustomOp.defjvp`` (#554) * [running] fix multiprocessing bugs * fix tests * [doc] update doc * update * [math] add `brainpy.math.gpu_memory_preallocation()` for controlling GPU memory preallocation * [math] `clear_buffer_memory` support to clear array and compilation both * [dyn] compatible old version of `.reset_state()` function * [setup] update installation info * [install] upgrade dependency * updates * [math] add `brainpy.math.defjvp`, support to define jvp rules for Primitive with multiple results. See examples in `test_ad_support.py` * [math] add `brainpy.math.XLACustomOp.defjvp` * [doc] upgrade `brainpy.math.defjvp` docstring * ⬆️ Bump actions/setup-python from 4 to 5 (#555) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Sichao He <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [math] add experimental `brainpy.math.exprel` * [delay] move delays in models of `brainpy.synapses` module into new delay register API `DynamicalSystem.register_local_delay()` and `DynamicalSystem.get_local_delay()` * [math & dyn] add `brainpy.math.exprel`, and change the code in the corresponding HH neuron models to improve numerical computation accuracy --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Sichao He <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5be1834
commit b1e80e8
Showing
10 changed files
with
90 additions
and
31 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
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
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,21 @@ | ||
|
||
import brainpy.math as bm | ||
from scipy.special import exprel | ||
|
||
from unittest import TestCase | ||
|
||
|
||
class Test_exprel(TestCase): | ||
def test1(self): | ||
for x in [1e-4, 1e-5, 1e-6, 1e-7, 1e-8, 1e-9]: | ||
print(f'{exprel(x)}, {bm.exprel(x)}, {exprel(x) - bm.exprel(x):.10f}') | ||
# self.assertEqual(exprel(x)) | ||
|
||
def test2(self): | ||
bm.enable_x64() | ||
for x in [1e-4, 1e-5, 1e-6, 1e-7, 1e-8, 1e-9]: | ||
print(f'{exprel(x)}, {bm.exprel(x)}, {exprel(x) - bm.exprel(x):.10f}') | ||
# self.assertEqual(exprel(x)) | ||
|
||
|
||
|
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