brainpy / BrainPy

Brain Dynamics Programming in Python
https://brainpy.readthedocs.io/
GNU General Public License v3.0
511 stars 93 forks source link

[docs] Update index.rst for surrogate gradient #437

Closed Routhleck closed 1 year ago

Routhleck commented 1 year ago

Description

Update index.rst for surrogate gradient and Corret some mistakes in saving_and_loading.ipynb

chaoming0625 commented 1 year ago

There is one missing note for Custom saving and loading:

For customizing the saving, users can use:


class YourClass(bp.BrainPyObject):
   def __save_state__(self):
     ....

For customizing the loading, users can use:


class YourClass(bp.BrainPyObject):
   def __load_state__(self, state_dict):
     ....

Great work by the way.

https://brainpy.readthedocs.io/en/latest/tutorial_toolbox/saving_and_loading.html

Routhleck commented 1 year ago

There is one missing note for Custom saving and loading:

For customizing the saving, users can use:

class YourClass(bp.BrainPyObject):
   def __save_state__(self):
     ....

For customizing the loading, users can use:

class YourClass(bp.BrainPyObject):
   def __load_state__(self, state_dict):
     ....

Great work by the way.

https://brainpy.readthedocs.io/en/latest/tutorial_toolbox/saving_and_loading.html

Understood👌