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

State saving, loading, and resetting #521

Merged
merged 10 commits into from
Oct 24, 2023
Merged

Conversation

chaoming0625
Copy link
Collaborator

APIs and docs for state saving, loading, and resetting

Description

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.

1. ``__load_state`` and ``__save_state__`` receive ``**kwargs`` inputs, meaning that each node can process information by using item in **kwargs

2. remove ``load_states`` and ``save_states``, and the associated io functionalities
1. all local state reset happens in `reset_state()` function

2. all states reset under this node occurs in `reset()` function
@chaoming0625
Copy link
Collaborator Author

From now on, the resetting of all states in the network should use

net.reset(batch_or_mode)

The reset_state() function only reset the local states in a node.

@chaoming0625 chaoming0625 requested a review from ztqakita October 24, 2023 11:33
@chaoming0625 chaoming0625 merged commit aa90559 into brainpy:master Oct 24, 2023
8 checks passed
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