Skip to content

brainpy.math.defjvp and brainpy.math.XLACustomOp.defjvp#554

Merged
chaoming0625 merged 14 commits intobrainpy:masterfrom
chaoming0625:master
Dec 4, 2023
Merged

brainpy.math.defjvp and brainpy.math.XLACustomOp.defjvp#554
chaoming0625 merged 14 commits intobrainpy:masterfrom
chaoming0625:master

Conversation

@chaoming0625
Copy link
Copy Markdown
Member

Description

  • Support brainpy.math.defjvp and brainpy.math.XLACustomOp.defjvp, similar to jax.interpreters.ad.defjvp. But these operators support defining jvp rules for Primitive with multiple results.
  • See examples in test_ad_support.py

How Has This Been Tested

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation (non-breaking change which updates documentation)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code style (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe here):

Checklist

  • Code follows the code style of this project.
  • Changes follow the CONTRIBUTING guidelines.
  • Update necessary documentation accordingly.
  • Lint and tests pass locally with the changes.
  • Check issues and pull requests first. You don't want to duplicate effort.

Other information

Copy link
Copy Markdown
Member

@Routhleck Routhleck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve!

@chaoming0625 chaoming0625 merged commit 8c28685 into brainpy:master Dec 4, 2023
chaoming0625 added a commit to chaoming0625/BrainPy that referenced this pull request Dec 7, 2023
* [running] fix multiprocessing bugs (brainpy#547)

* [running] fix multiprocessing bugs

* fix tests

* [docs] Fix typo in docs (brainpy#549)

* ⬆️ Bump conda-incubator/setup-miniconda from 2 to 3 (brainpy#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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* updates  (brainpy#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`` (brainpy#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 (brainpy#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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sichao He <1310722434@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
chaoming0625 added a commit that referenced this pull request Dec 7, 2023
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
...




* 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] <support@github.com>
Co-authored-by: Sichao He <1310722434@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
chaoming0625 added a commit that referenced this pull request Dec 10, 2023
…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] <support@github.com>
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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sichao He <1310722434@qq.com>
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] <support@github.com>
Co-authored-by: Sichao He <1310722434@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants