brainstate 0.1.4__py2.py3-none-any.whl → 0.1.6__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. brainstate/__init__.py +1 -1
  2. brainstate/_state.py +6 -5
  3. brainstate/augment/_autograd.py +31 -12
  4. brainstate/augment/_autograd_test.py +46 -46
  5. brainstate/augment/_eval_shape.py +4 -4
  6. brainstate/augment/_mapping.py +22 -17
  7. brainstate/augment/_mapping_test.py +162 -0
  8. brainstate/compile/_conditions.py +2 -2
  9. brainstate/compile/_make_jaxpr.py +59 -6
  10. brainstate/compile/_progress_bar.py +2 -2
  11. brainstate/environ.py +19 -19
  12. brainstate/functional/_activations_test.py +12 -12
  13. brainstate/graph/_graph_operation.py +69 -69
  14. brainstate/graph/_graph_operation_test.py +2 -2
  15. brainstate/mixin.py +0 -17
  16. brainstate/nn/_collective_ops.py +4 -4
  17. brainstate/nn/_common.py +7 -19
  18. brainstate/nn/_dropout_test.py +2 -2
  19. brainstate/nn/_dynamics.py +53 -35
  20. brainstate/nn/_elementwise.py +30 -30
  21. brainstate/nn/_exp_euler.py +13 -16
  22. brainstate/nn/_inputs.py +1 -1
  23. brainstate/nn/_linear.py +4 -4
  24. brainstate/nn/_module.py +6 -6
  25. brainstate/nn/_module_test.py +1 -1
  26. brainstate/nn/_normalizations.py +11 -11
  27. brainstate/nn/_normalizations_test.py +6 -6
  28. brainstate/nn/_poolings.py +24 -24
  29. brainstate/nn/_synapse.py +1 -12
  30. brainstate/nn/_utils.py +1 -1
  31. brainstate/nn/metrics.py +4 -4
  32. brainstate/optim/_optax_optimizer.py +8 -8
  33. brainstate/random/_rand_funs.py +37 -37
  34. brainstate/random/_rand_funs_test.py +3 -3
  35. brainstate/random/_rand_seed.py +7 -7
  36. brainstate/random/_rand_state.py +13 -7
  37. brainstate/surrogate.py +40 -40
  38. brainstate/util/pretty_pytree.py +10 -10
  39. brainstate/util/{_pretty_pytree_test.py → pretty_pytree_test.py} +36 -37
  40. brainstate/util/struct.py +7 -7
  41. {brainstate-0.1.4.dist-info → brainstate-0.1.6.dist-info}/METADATA +12 -12
  42. {brainstate-0.1.4.dist-info → brainstate-0.1.6.dist-info}/RECORD +45 -45
  43. {brainstate-0.1.4.dist-info → brainstate-0.1.6.dist-info}/WHEEL +1 -1
  44. {brainstate-0.1.4.dist-info → brainstate-0.1.6.dist-info}/LICENSE +0 -0
  45. {brainstate-0.1.4.dist-info → brainstate-0.1.6.dist-info}/top_level.txt +0 -0
@@ -373,19 +373,19 @@ class NestedDict(PrettyDict):
373
373
 
374
374
  Example usage::
375
375
 
376
- >>> import brainstate as bst
376
+ >>> import brainstate as brainstate
377
377
 
378
- >>> class Model(bst.nn.Module):
378
+ >>> class Model(brainstate.nn.Module):
379
379
  ... def __init__(self):
380
380
  ... super().__init__()
381
- ... self.batchnorm = bst.nn.BatchNorm1d([10, 3])
382
- ... self.linear = bst.nn.Linear(2, 3)
381
+ ... self.batchnorm = brainstate.nn.BatchNorm1d([10, 3])
382
+ ... self.linear = brainstate.nn.Linear(2, 3)
383
383
  ... def __call__(self, x):
384
384
  ... return self.linear(self.batchnorm(x))
385
385
 
386
386
  >>> model = Model()
387
- >>> state_map = bst.graph.treefy_states(model)
388
- >>> param, others = state_map.treefy_split(bst.ParamState, ...)
387
+ >>> state_map = brainstate.graph.treefy_states(model)
388
+ >>> param, others = state_map.treefy_split(brainstate.ParamState, ...)
389
389
 
390
390
  Arguments:
391
391
  first: The first filter
@@ -495,14 +495,14 @@ class FlattedDict(PrettyDict):
495
495
 
496
496
  Example usage::
497
497
 
498
- >>> import brainstate as bst
498
+ >>> import brainstate as brainstate
499
499
  >>> import jax.numpy as jnp
500
500
  >>>
501
- >>> class Model(bst.nn.Module):
501
+ >>> class Model(brainstate.nn.Module):
502
502
  ... def __init__(self):
503
503
  ... super().__init__()
504
- ... self.batchnorm = bst.nn.BatchNorm1d([10, 3])
505
- ... self.linear = bst.nn.Linear(2, 3)
504
+ ... self.batchnorm = brainstate.nn.BatchNorm1d([10, 3])
505
+ ... self.linear = brainstate.nn.Linear(2, 3)
506
506
  ... def __call__(self, x):
507
507
  ... return self.linear(self.batchnorm(x))
508
508
  >>>
@@ -13,31 +13,30 @@
13
13
  # limitations under the License.
14
14
  # ==============================================================================
15
15
 
16
- from __future__ import annotations
17
16
 
18
17
  import unittest
19
18
 
20
19
  import jax
21
20
  from absl.testing import absltest
22
21
 
23
- import brainstate as bst
22
+ import brainstate
24
23
 
25
24
 
26
25
  class TestNestedMapping(absltest.TestCase):
27
26
  def test_create_state(self):
28
- state = bst.util.NestedDict({'a': bst.ParamState(1), 'b': {'c': bst.ParamState(2)}})
27
+ state = brainstate.util.NestedDict({'a': brainstate.ParamState(1), 'b': {'c': brainstate.ParamState(2)}})
29
28
 
30
29
  assert state['a'].value == 1
31
30
  assert state['b']['c'].value == 2
32
31
 
33
32
  def test_get_attr(self):
34
- state = bst.util.NestedDict({'a': bst.ParamState(1), 'b': {'c': bst.ParamState(2)}})
33
+ state = brainstate.util.NestedDict({'a': brainstate.ParamState(1), 'b': {'c': brainstate.ParamState(2)}})
35
34
 
36
35
  assert state.a.value == 1
37
36
  assert state.b['c'].value == 2
38
37
 
39
38
  def test_set_attr(self):
40
- state = bst.util.NestedDict({'a': bst.ParamState(1), 'b': {'c': bst.ParamState(2)}})
39
+ state = brainstate.util.NestedDict({'a': brainstate.ParamState(1), 'b': {'c': brainstate.ParamState(2)}})
41
40
 
42
41
  state.a.value = 3
43
42
  state.b['c'].value = 4
@@ -46,36 +45,36 @@ class TestNestedMapping(absltest.TestCase):
46
45
  assert state['b']['c'].value == 4
47
46
 
48
47
  def test_set_attr_variables(self):
49
- state = bst.util.NestedDict({'a': bst.ParamState(1), 'b': {'c': bst.ParamState(2)}})
48
+ state = brainstate.util.NestedDict({'a': brainstate.ParamState(1), 'b': {'c': brainstate.ParamState(2)}})
50
49
 
51
50
  state.a.value = 3
52
51
  state.b['c'].value = 4
53
52
 
54
- assert isinstance(state.a, bst.ParamState)
53
+ assert isinstance(state.a, brainstate.ParamState)
55
54
  assert state.a.value == 3
56
- assert isinstance(state.b['c'], bst.ParamState)
55
+ assert isinstance(state.b['c'], brainstate.ParamState)
57
56
  assert state.b['c'].value == 4
58
57
 
59
58
  def test_add_nested_attr(self):
60
- state = bst.util.NestedDict({'a': bst.ParamState(1), 'b': {'c': bst.ParamState(2)}})
61
- state.b['d'] = bst.ParamState(5)
59
+ state = brainstate.util.NestedDict({'a': brainstate.ParamState(1), 'b': {'c': brainstate.ParamState(2)}})
60
+ state.b['d'] = brainstate.ParamState(5)
62
61
 
63
62
  assert state['b']['d'].value == 5
64
63
 
65
64
  def test_delete_nested_attr(self):
66
- state = bst.util.NestedDict({'a': bst.ParamState(1), 'b': {'c': bst.ParamState(2)}})
65
+ state = brainstate.util.NestedDict({'a': brainstate.ParamState(1), 'b': {'c': brainstate.ParamState(2)}})
67
66
  del state['b']['c']
68
67
 
69
68
  assert 'c' not in state['b']
70
69
 
71
70
  def test_integer_access(self):
72
- class Foo(bst.nn.Module):
71
+ class Foo(brainstate.nn.Module):
73
72
  def __init__(self):
74
73
  super().__init__()
75
- self.layers = [bst.nn.Linear(1, 2), bst.nn.Linear(2, 3)]
74
+ self.layers = [brainstate.nn.Linear(1, 2), brainstate.nn.Linear(2, 3)]
76
75
 
77
76
  module = Foo()
78
- state_refs = bst.graph.treefy_states(module)
77
+ state_refs = brainstate.graph.treefy_states(module)
79
78
 
80
79
  assert module.layers[0].weight.value['weight'].shape == (1, 2)
81
80
  assert state_refs.layers[0]['weight'].value['weight'].shape == (1, 2)
@@ -83,8 +82,8 @@ class TestNestedMapping(absltest.TestCase):
83
82
  assert state_refs.layers[1]['weight'].value['weight'].shape == (2, 3)
84
83
 
85
84
  def test_pure_dict(self):
86
- module = bst.nn.Linear(4, 5)
87
- state_map = bst.graph.treefy_states(module)
85
+ module = brainstate.nn.Linear(4, 5)
86
+ state_map = brainstate.graph.treefy_states(module)
88
87
  pure_dict = state_map.to_pure_dict()
89
88
  assert isinstance(pure_dict, dict)
90
89
  assert isinstance(pure_dict['weight'].value['weight'], jax.Array)
@@ -93,27 +92,27 @@ class TestNestedMapping(absltest.TestCase):
93
92
 
94
93
  class TestSplit(unittest.TestCase):
95
94
  def test_split(self):
96
- class Model(bst.nn.Module):
95
+ class Model(brainstate.nn.Module):
97
96
  def __init__(self):
98
97
  super().__init__()
99
- self.batchnorm = bst.nn.BatchNorm1d([10, 3])
100
- self.linear = bst.nn.Linear([10, 3], [10, 4])
98
+ self.batchnorm = brainstate.nn.BatchNorm1d([10, 3])
99
+ self.linear = brainstate.nn.Linear([10, 3], [10, 4])
101
100
 
102
101
  def __call__(self, x):
103
102
  return self.linear(self.batchnorm(x))
104
103
 
105
- with bst.environ.context(fit=True):
104
+ with brainstate.environ.context(fit=True):
106
105
  model = Model()
107
- x = bst.random.randn(1, 10, 3)
106
+ x = brainstate.random.randn(1, 10, 3)
108
107
  y = model(x)
109
108
  self.assertEqual(y.shape, (1, 10, 4))
110
109
 
111
- state_map = bst.graph.treefy_states(model)
110
+ state_map = brainstate.graph.treefy_states(model)
112
111
 
113
112
  with self.assertRaises(ValueError):
114
- params, others = state_map.split(bst.ParamState)
113
+ params, others = state_map.split(brainstate.ParamState)
115
114
 
116
- params, others = state_map.split(bst.ParamState, ...)
115
+ params, others = state_map.split(brainstate.ParamState, ...)
117
116
  print()
118
117
  print(params)
119
118
  print(others)
@@ -124,37 +123,37 @@ class TestSplit(unittest.TestCase):
124
123
 
125
124
  class TestStateMap2(unittest.TestCase):
126
125
  def test1(self):
127
- class Model(bst.nn.Module):
126
+ class Model(brainstate.nn.Module):
128
127
  def __init__(self):
129
128
  super().__init__()
130
- self.batchnorm = bst.nn.BatchNorm1d([10, 3])
131
- self.linear = bst.nn.Linear([10, 3], [10, 4])
129
+ self.batchnorm = brainstate.nn.BatchNorm1d([10, 3])
130
+ self.linear = brainstate.nn.Linear([10, 3], [10, 4])
132
131
 
133
132
  def __call__(self, x):
134
133
  return self.linear(self.batchnorm(x))
135
134
 
136
- with bst.environ.context(fit=True):
135
+ with brainstate.environ.context(fit=True):
137
136
  model = Model()
138
- state_map = bst.graph.treefy_states(model).to_flat()
139
- state_map = bst.util.NestedDict(state_map)
137
+ state_map = brainstate.graph.treefy_states(model).to_flat()
138
+ state_map = brainstate.util.NestedDict(state_map)
140
139
 
141
140
 
142
141
  class TestFlattedMapping(unittest.TestCase):
143
142
  def test1(self):
144
- class Model(bst.nn.Module):
143
+ class Model(brainstate.nn.Module):
145
144
  def __init__(self):
146
145
  super().__init__()
147
- self.batchnorm = bst.nn.BatchNorm1d([10, 3])
148
- self.linear = bst.nn.Linear([10, 3], [10, 4])
146
+ self.batchnorm = brainstate.nn.BatchNorm1d([10, 3])
147
+ self.linear = brainstate.nn.Linear([10, 3], [10, 4])
149
148
 
150
149
  def __call__(self, x):
151
150
  return self.linear(self.batchnorm(x))
152
151
 
153
152
  model = Model()
154
153
  # print(model.states())
155
- # print(bst.graph.states(model))
156
- self.assertTrue(model.states() == bst.graph.states(model))
154
+ # print(brainstate.graph.states(model))
155
+ self.assertTrue(model.states() == brainstate.graph.states(model))
157
156
 
158
157
  print(model.nodes())
159
- # print(bst.graph.nodes(model))
160
- self.assertTrue(model.nodes() == bst.graph.nodes(model))
158
+ # print(brainstate.graph.nodes(model))
159
+ self.assertTrue(model.nodes() == brainstate.graph.nodes(model))
brainstate/util/struct.py CHANGED
@@ -56,16 +56,16 @@ def dataclass(clz: T, **kwargs) -> T:
56
56
  The ``dataclass`` decorator makes it easy to define custom classes that can be
57
57
  passed safely to Jax. For example::
58
58
 
59
- >>> import brainstate as bst
59
+ >>> import brainstate as brainstate
60
60
  >>> import jax
61
61
  >>> from typing import Any, Callable
62
62
 
63
- >>> @bst.util.dataclass
63
+ >>> @brainstate.util.dataclass
64
64
  ... class Model:
65
65
  ... params: Any
66
66
  ... # use pytree_node=False to indicate an attribute should not be touched
67
67
  ... # by Jax transformations.
68
- ... apply_fn: Callable = bst.util.field(pytree_node=False)
68
+ ... apply_fn: Callable = brainstate.util.field(pytree_node=False)
69
69
 
70
70
  ... def __apply__(self, *args):
71
71
  ... return self.apply_fn(*args)
@@ -97,7 +97,7 @@ def dataclass(clz: T, **kwargs) -> T:
97
97
  This way the simple constructor used by ``jax.tree_util`` is
98
98
  preserved. Consider the following example::
99
99
 
100
- >>> @bst.util.dataclass
100
+ >>> @brainstate.util.dataclass
101
101
  ... class DirectionAndScaleKernel:
102
102
  ... direction: jax.Array
103
103
  ... scale: jax.Array
@@ -189,15 +189,15 @@ class PyTreeNode:
189
189
 
190
190
  Example::
191
191
 
192
- >>> import brainstate as bst
192
+ >>> import brainstate as brainstate
193
193
  >>> import jax
194
194
  >>> from typing import Any, Callable
195
195
 
196
- >>> class Model(bst.util.PyTreeNode):
196
+ >>> class Model(brainstate.util.PyTreeNode):
197
197
  ... params: Any
198
198
  ... # use pytree_node=False to indicate an attribute should not be touched
199
199
  ... # by Jax transformations.
200
- ... apply_fn: Callable = bst.util.field(pytree_node=False)
200
+ ... apply_fn: Callable = brainstate.util.field(pytree_node=False)
201
201
 
202
202
  ... def __apply__(self, *args):
203
203
  ... return self.apply_fn(*args)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: brainstate
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: A ``State``-based Transformation System for Program Compilation and Augmentation.
5
5
  Home-page: https://github.com/chaobrain/brainstate
6
6
  Author: BrainState Developers
@@ -31,22 +31,22 @@ License-File: LICENSE
31
31
  Requires-Dist: jax
32
32
  Requires-Dist: jaxlib
33
33
  Requires-Dist: numpy
34
- Requires-Dist: brainunit (>=0.0.4)
34
+ Requires-Dist: brainunit>=0.0.4
35
35
  Requires-Dist: brainevent
36
36
  Provides-Extra: cpu
37
- Requires-Dist: jax[cpu] ; extra == 'cpu'
38
- Requires-Dist: brainunit[cpu] ; extra == 'cpu'
39
- Requires-Dist: brainevent[cpu] ; extra == 'cpu'
37
+ Requires-Dist: jax[cpu]; extra == "cpu"
38
+ Requires-Dist: brainunit[cpu]; extra == "cpu"
39
+ Requires-Dist: brainevent[cpu]; extra == "cpu"
40
40
  Provides-Extra: cuda12
41
- Requires-Dist: jax[cuda12] ; extra == 'cuda12'
42
- Requires-Dist: brainunit[cuda12] ; extra == 'cuda12'
43
- Requires-Dist: brainevent[cuda12] ; extra == 'cuda12'
41
+ Requires-Dist: jax[cuda12]; extra == "cuda12"
42
+ Requires-Dist: brainunit[cuda12]; extra == "cuda12"
43
+ Requires-Dist: brainevent[cuda12]; extra == "cuda12"
44
44
  Provides-Extra: testing
45
- Requires-Dist: pytest ; extra == 'testing'
45
+ Requires-Dist: pytest; extra == "testing"
46
46
  Provides-Extra: tpu
47
- Requires-Dist: jax[tpu] ; extra == 'tpu'
48
- Requires-Dist: brainunit[tpu] ; extra == 'tpu'
49
- Requires-Dist: brainevent[tpu] ; extra == 'tpu'
47
+ Requires-Dist: jax[tpu]; extra == "tpu"
48
+ Requires-Dist: brainunit[tpu]; extra == "tpu"
49
+ Requires-Dist: brainevent[tpu]; extra == "tpu"
50
50
 
51
51
 
52
52
  # A ``State``-based Transformation System for Program Compilation and Augmentation
@@ -1,27 +1,27 @@
1
- brainstate/__init__.py,sha256=A_OD4cJiVu3xpthNGJh6fhRjCKsI7_Mxsow3Al4m2-w,1496
1
+ brainstate/__init__.py,sha256=jCLuGmUnNNYYpHUGsGZrw--LWrAtO0m1ABtU_1qvtRM,1496
2
2
  brainstate/_compatible_import.py,sha256=LUSZlA0APWozxM8Kf9pZrM2YbwY7X3jzVVHZInaBL7Y,4630
3
- brainstate/_state.py,sha256=o5Kk4bGwVz6Dfj9dlmZqdh6zUXcz6Tvc6WOjH9ajlIU,60716
3
+ brainstate/_state.py,sha256=PLzoYx13jIgnzyBxnktLTVPCFl6seG__aNIHS9A5Nms,60770
4
4
  brainstate/_state_test.py,sha256=b6uvZdVRyC4n6-fYzmHNry1b-gJ6zE_kRSxGinqiHaw,1638
5
5
  brainstate/_utils.py,sha256=j-b239RHfC5BnvhGbSExQpdY21LrMEyWMSHBdNGThOI,1657
6
- brainstate/environ.py,sha256=VgtG0S_aR1g_1gplRWg_v2ZrcS-F6LZk35BPCBgsIIA,17660
6
+ brainstate/environ.py,sha256=vxwGyYm4lf9Ym5iD6YHsYy4bTwmeD8yHIuZsqqGfP4s,17793
7
7
  brainstate/environ_test.py,sha256=QD6sPCKNtqemVCGwkdImjMazatrvvLr6YeAVcfUnVVY,2045
8
- brainstate/mixin.py,sha256=LOS8WPfB6OBevdZ9wh_U6qzuw4mrCNAMcJy0yIitIBg,11522
8
+ brainstate/mixin.py,sha256=eOOODmESCYITJbvz6dnQLyu8u2m0YrTaEvZsepdAUto,10991
9
9
  brainstate/mixin_test.py,sha256=Oq_0fwC9vpXDN4t4dTBhWzLdFDNlcYsrcip14F1yECI,3079
10
- brainstate/surrogate.py,sha256=yPc-uhJl1r14leoKAAgTWlqBZoeH-uYUAeizuQLkJec,53455
10
+ brainstate/surrogate.py,sha256=zCNrJG-UMuvH7Le7iBuolDc-Oy8UY-xvw77tNhkGvK8,53861
11
11
  brainstate/transform.py,sha256=OvshYpPnp3YXPG6riy15Ve7jcX8t0aaATl1xZnsFeic,858
12
12
  brainstate/typing.py,sha256=cIlcgaWbvsFyEb5GgwZD7NHJh9qAp8l-N-rYN5W9FsU,10519
13
13
  brainstate/augment/__init__.py,sha256=Q9-JIwQ1FNn8VLS1MA9MrSylbvUjWSw98whrI3NIuKo,1229
14
- brainstate/augment/_autograd.py,sha256=zMMLZOidQq2p96wzEOgR-MynV2JH1l1AnoJ28eVwD-s,30100
15
- brainstate/augment/_autograd_test.py,sha256=UhNd41luca_Kj9a8byL3Dq64Ta55WU-je-LCiK_z0Vc,45060
16
- brainstate/augment/_eval_shape.py,sha256=mYRB5clSRHdXX0c4c5_WDIIBtRl4a9-xl8Tg60mgLBI,3854
14
+ brainstate/augment/_autograd.py,sha256=XG0BgWrZ7LPelt2nRBKhpiMqz9jNS8NsK7x_I3DJINs,30884
15
+ brainstate/augment/_autograd_test.py,sha256=1gR_38_i3pfH4S744G9x4KfGGtlyY0MBt43R_fndd9A,45396
16
+ brainstate/augment/_eval_shape.py,sha256=jyzFzvZnUkbky7lxuchyFNGn0oJP1u10ZH5p79tAYMI,3868
17
17
  brainstate/augment/_eval_shape_test.py,sha256=WXrmZKmnykmYPveRfZbrDF0sFm2_PTr982yl4JM7Ebg,1390
18
- brainstate/augment/_mapping.py,sha256=AvGt8qhOdBgRJyWZn7J5JnOvxZc7XfZ_JKXaECOQjIw,43500
19
- brainstate/augment/_mapping_test.py,sha256=An5iSqrAXq_OVTvY3GFTjsB9AvFZ4j6AWNZQ_WWfra4,15319
18
+ brainstate/augment/_mapping.py,sha256=R9CYp8JrdWpQcQE-XGr7POXyHqIEAYPxZfWqHF-wc70,43815
19
+ brainstate/augment/_mapping_test.py,sha256=tEyXioA4_v4WGRFrpgUInyKyBjAVNLonWdHKVacmphU,21946
20
20
  brainstate/augment/_random.py,sha256=bkngsIk6Wwi3e46I7YSbBjLCGAz0Q3WuadUH4mqTjbY,5348
21
21
  brainstate/compile/__init__.py,sha256=fQtG316MLkeeu1Ssp54Kghw1PwbGK5gNq9yRVJu0wjA,1474
22
22
  brainstate/compile/_ad_checkpoint.py,sha256=HM6L90HU0N84S30uJpX8wqTO0ZcDnctqmwf8qFlkDYo,9358
23
23
  brainstate/compile/_ad_checkpoint_test.py,sha256=XGqC8kjwKd64RPgBWXHAE3t8NdIXVUqmGDfrg5HqoVw,1743
24
- brainstate/compile/_conditions.py,sha256=fFSJWRFZxriAZFASj2lvlXpxbH323XcfsoB9ni2CYZ0,10183
24
+ brainstate/compile/_conditions.py,sha256=Pkvkc1Im7_ythKa9nwrUCNxYwkZri78I91MKbo1lEX8,10183
25
25
  brainstate/compile/_conditions_test.py,sha256=bh8_D49Fl-s_xFYkO4joZJPgFGhw_vd6Wo8QB1HDKwE,8640
26
26
  brainstate/compile/_error_if.py,sha256=l8flahWEui9-9IavtZQjyutIeR8DU0jieahRvAXUxuw,2651
27
27
  brainstate/compile/_error_if_test.py,sha256=PjTIQOflegqnqJb9kO5YqwjW1OfrBmAtWlY_xn8rtDY,1897
@@ -31,22 +31,22 @@ brainstate/compile/_loop_collect_return.py,sha256=qOYGoD2TMZd2Px6y241GWNwSjOLyaK
31
31
  brainstate/compile/_loop_collect_return_test.py,sha256=pEJdcOthEM17q5kXYhgR6JfzzqibijD_O1VPXVe_Ml4,1808
32
32
  brainstate/compile/_loop_no_collection.py,sha256=tPkSxee41VexWEALpN1uuT78BDrX3uT1FHv8WZtov4c,7549
33
33
  brainstate/compile/_loop_no_collection_test.py,sha256=ivavF59xep_g9bV1SSdXd5E1f6nhc7EUBfcbgHpxbfg,1419
34
- brainstate/compile/_make_jaxpr.py,sha256=fhaazC2Lj8-Gk3VpWLSytzVbP9dLkuTAn_1Y0SBtC9s,35864
34
+ brainstate/compile/_make_jaxpr.py,sha256=3VYwfjmHSp5Uh_VEQVXYgxsUcpWcDN_2tNnZKh1dFV0,37736
35
35
  brainstate/compile/_make_jaxpr_test.py,sha256=xPusEJikMQRfoOmUFrugGcE5UpRm0giHoL_NPomN5rI,4791
36
- brainstate/compile/_progress_bar.py,sha256=iTp-CkcK5aMbiA0ZdlSfEXXrc4_anifYhyDzl19dksI,7488
36
+ brainstate/compile/_progress_bar.py,sha256=AhAyyI_ckzgaj0PSj1ep1hq8rGzQLSyC2aVCYaT-e-o,7502
37
37
  brainstate/compile/_unvmap.py,sha256=9S42MeTmFJa8nfBI_AjEfrAdUsDmM3KFat59O8zXIEw,4120
38
38
  brainstate/compile/_util.py,sha256=QD7lvS4Zb3P2HPNIm6mG8Rl_Lk2tQj0znOCPcH95XnI,6275
39
39
  brainstate/functional/__init__.py,sha256=j6-3Er4fgqWpvntzYCZVB3e5hoz-Z3aqvapITCuDri0,1107
40
40
  brainstate/functional/_activations.py,sha256=3ym1oDdftVxYlHIXWdS7XONiDFaDklqokIioi4qrsHo,21688
41
- brainstate/functional/_activations_test.py,sha256=66PTMI99pfi1hr2rfFixg2OlUN0WME9628T7U2NF0iI,13475
41
+ brainstate/functional/_activations_test.py,sha256=3YR43Jyls2wWYKI-phsf6b1ZdgZa578ob1TfkitroMI,13559
42
42
  brainstate/functional/_normalization.py,sha256=_F5u9iJm8KJfxlnmV_LwJXtrAZOJj357aXc_sfGe4CQ,2567
43
43
  brainstate/functional/_others.py,sha256=iAqvLCmXQz6C80EjE0-5bwXCBKHoKqsggneiOAXNmQo,1699
44
44
  brainstate/functional/_spikes.py,sha256=YJ4pa5LlywximSE6ZAAs9g2k-8cO95mwxdD29HhT-oM,7051
45
45
  brainstate/graph/__init__.py,sha256=noo4TjBg6iEhjjwk0sAGUhR7Ge-z8Vnc2rLYUvnqttw,1295
46
46
  brainstate/graph/_graph_node.py,sha256=kl0CDKIcbXd9YzrZIKDhDeT8bboaoR5_OPwtL90eUEo,6835
47
47
  brainstate/graph/_graph_node_test.py,sha256=g6nrCCI-awfxhZLnjmYhfQvynumWJjz7fPxgIF-VSr4,2832
48
- brainstate/graph/_graph_operation.py,sha256=h2rdydWr9AHBMVlyYpBN9GdbVkPIgyjsctZXa8EmxQI,63401
49
- brainstate/graph/_graph_operation_test.py,sha256=nxMwEoaRZpTkIeR3h_Aduuys0Bm1DRlYLd_CXkErTSg,19715
48
+ brainstate/graph/_graph_operation.py,sha256=nIOW0GsA3Yeh8X_ijw5wx4hQgY2sh4knVMt5ouG2Sn0,63975
49
+ brainstate/graph/_graph_operation_test.py,sha256=xgHoHXAafEhOqISDKLqYxb-wmMrUpv2PLtH5OLZausI,19729
50
50
  brainstate/init/__init__.py,sha256=R1dHgub47o-WJM9QkFLc7x_Q7GsyaKKDtrRHTFPpC5g,1097
51
51
  brainstate/init/_base.py,sha256=A5VIJV_xPyCD4Lo4RXe2WPlWvADAy_UPhexuwzp-6EI,1633
52
52
  brainstate/init/_generic.py,sha256=o60EPJZe7laJgPsgrnorl3Km_Lc_Lr4qQQKmu6g5G4o,7992
@@ -55,36 +55,36 @@ brainstate/init/_random_inits_test.py,sha256=c1pUdWXQxL-seEvjO_8fBkaDL6T63b6ALNf
55
55
  brainstate/init/_regular_inits.py,sha256=tcZDTXR8jiRqERuJleg_9JRGGzJj-V3LhTMcr_gt_k0,3149
56
56
  brainstate/init/_regular_inits_test.py,sha256=bvv0AOfLOEP0BIQIBLztKw3EPyEp7n2fHW8PUrmWuHk,1820
57
57
  brainstate/nn/__init__.py,sha256=nDIBDlzHaBy-vk4cb7FiPO6zoNe2tI5qvHIK8O7yrOU,3721
58
- brainstate/nn/_collective_ops.py,sha256=rWcjqaP0rW6sXdhE0fjtDi4twmq5VvhNEg8AoiQ-tDU,17390
58
+ brainstate/nn/_collective_ops.py,sha256=Mmg-0ImuGvpv2qggu5wfBrA0MLBaq96D0P5DCZ3yolY,17418
59
59
  brainstate/nn/_collective_ops_test.py,sha256=bwq0DApcsk0_2xpxMl0_e2cGKT63g5rSngpigCm07ps,1409
60
- brainstate/nn/_common.py,sha256=Pt8P1LgE0qW3QnfX8CQQGH3yZ78RL7NkIqqYEw_z8xs,7096
60
+ brainstate/nn/_common.py,sha256=qHAOID_eeKiPUXk_ION65sbYXyF-ddH5w5BayvH8Thg,6431
61
61
  brainstate/nn/_conv.py,sha256=Zk-yj34n6CkjntcM9xpMGLTxKNfWdIWsTsoGbtdL0yU,18448
62
62
  brainstate/nn/_conv_test.py,sha256=2lcUTG7twkyhuyKwuBux-NgU8NU_W4Cp1-G8EyDJ_uk,8862
63
63
  brainstate/nn/_delay.py,sha256=l36FBgNhfL64tM3VGOsJNTtKr44HjxxtBWMFFCm3Pks,17361
64
64
  brainstate/nn/_dropout.py,sha256=Dq3hQrOBT6gODlDbcoag6zLGXTU_p_2MhnmVsV57Hds,17783
65
- brainstate/nn/_dropout_test.py,sha256=9i2ZW5by0S9zfVHmZKLN0WpI1bXH6h9-QLXamG6lVXA,4432
66
- brainstate/nn/_dynamics.py,sha256=Rx4Hwl87H94DgMM644hDi3nN9D0wvXkpWrog_Ek1sr4,47734
65
+ brainstate/nn/_dropout_test.py,sha256=L46PvC2OA7EnS4MsRhh_YnvKheHYNafOsKM8uzux_zo,4446
66
+ brainstate/nn/_dynamics.py,sha256=PTTGDqe-uRvrTZbhNGy1O4hT_wG4vxbOXyfbOx2itaw,48341
67
67
  brainstate/nn/_dynamics_test.py,sha256=w7AV57LdhbBNYprdFpKq8MFSCbXKVkGgp_NbL3ANX3I,2769
68
- brainstate/nn/_elementwise.py,sha256=4czeJWGQopV49iZo8DuN_WzAbXoMC1gtqaGjlON6e7c,33291
68
+ brainstate/nn/_elementwise.py,sha256=l3Wk65UDLFc3xFH1jwTXRwKAVmt3dUeG0iF_Al0w1_0,33487
69
69
  brainstate/nn/_elementwise_test.py,sha256=_dd9eX2ZJ7p24ahuoapCaRTZ0g1boufXMyqHFx1d4WY,5688
70
70
  brainstate/nn/_embedding.py,sha256=SaAJbgXmuJ8XlCOX9ob4yvmgh9Fk627wMguRzJMJ1H8,2138
71
- brainstate/nn/_exp_euler.py,sha256=ndDB43PM4jsZKu_zdLTZ2-ojnuNrg55LZap23oBTtdA,3493
71
+ brainstate/nn/_exp_euler.py,sha256=WTpZm-XQmsdMLNazY7wIu8eeO6pK0kRzt2lJnhEgMIk,3293
72
72
  brainstate/nn/_exp_euler_test.py,sha256=XD--qMbGHrHa3WtcPMmJKk59giDcEhSqZuBOmTNYUr8,1227
73
73
  brainstate/nn/_fixedprob.py,sha256=KGXohiU0wZnFIQDuwiRUTFsbsr8R0p8zgi5UZDuv1Bk,10004
74
74
  brainstate/nn/_fixedprob_test.py,sha256=qbRBh-MpMtEOsg492gFu2w9-FOP9z_bXapm-Q0gLLYM,3929
75
- brainstate/nn/_inputs.py,sha256=wPOfPE4IesNoDmxZJxqR0siBlJioEX-_1IZ2cltAIpM,20605
76
- brainstate/nn/_linear.py,sha256=5WuhcqU-uBUC91vnwezQYMHPKmlZPDgIJ5UpffxoX1I,14472
75
+ brainstate/nn/_inputs.py,sha256=hMPkx9qDBpJWPshZXLF4H1QiYK1-46wntHUIlG7cT7c,20603
76
+ brainstate/nn/_linear.py,sha256=FnPxATdT66DecjTW0tUTyL6clQmN_cG8kPC3qDWUE6A,14500
77
77
  brainstate/nn/_linear_mv.py,sha256=6hDXx4yPqRSa7uIsW9f9eJuy23dcXN9Mp2_lSvw8BDA,2635
78
78
  brainstate/nn/_linear_mv_test.py,sha256=ZCM1Zy6mImQfCfdZOGnTwkiLLPXK5yalv1Ts9sWZuPA,3864
79
79
  brainstate/nn/_linear_test.py,sha256=eIS-VCR3QmXB_byO1Uexg65Pv48CBRUA_Je-UGrFVTY,2925
80
80
  brainstate/nn/_ltp.py,sha256=_najNUyfaFYcOlUTm7ThJopInbos3kwJyrm-QUfI-hc,861
81
- brainstate/nn/_module.py,sha256=tleUiEd3ytEx4fZLu9NButELVlbKZNIQbXX78bdK8QU,12770
82
- brainstate/nn/_module_test.py,sha256=_RKHY8LHg6nbFHkvPAsEPVpp9rW6XfrcF8YD68u4o4w,8956
81
+ brainstate/nn/_module.py,sha256=jlFaoltT2F8a7cxsyu6fXp7mfIkEsk-JD3G1Xh3Ay8I,12783
82
+ brainstate/nn/_module_test.py,sha256=sjT7t-N4ZZKPN_MujNv8bcT5uZQD-CmU5nKz9KwlBUc,8963
83
83
  brainstate/nn/_neuron.py,sha256=2walTScvL034LS53pArDASXz6z26SSPbmCvchWWjkUU,27441
84
84
  brainstate/nn/_neuron_test.py,sha256=QF8pixUqA5Oj7MrNi2NR8VAnfGpAvNpwV2mBc3e_pTY,6393
85
- brainstate/nn/_normalizations.py,sha256=4B1YVI6AZyJLHseJK9eiSeMOIq--0ZuDG58iC9mrekE,37387
86
- brainstate/nn/_normalizations_test.py,sha256=JTqpH265GT0eKw3hXmT0qC8ZM5NkUe98of0uYS7_5Us,2456
87
- brainstate/nn/_poolings.py,sha256=h5aIj_K3X2HSMjrOtkgwiCpvLxfXXEUvFFa57Cxp5bI,46969
85
+ brainstate/nn/_normalizations.py,sha256=YSC1W7JaexoZ8tKcy5B-dm-_x8GuPzS_6XBfkaKpdXM,37464
86
+ brainstate/nn/_normalizations_test.py,sha256=56YfszPQW9y3VoX90-seyLeWDX8akYQTRLNBvrobmS0,2498
87
+ brainstate/nn/_poolings.py,sha256=yKG9BLnvDvZb7HMrAt4Y1sLCjFQ8UmWfSSQmICAPWag,47137
88
88
  brainstate/nn/_poolings_test.py,sha256=qje9PVWvPGiYOv6UlTEWfpqqjpv4Xop5rO0ATcgcF0w,7497
89
89
  brainstate/nn/_projection.py,sha256=_TW-YmfPqUDkekMMK7tXrdLbjT4Ou2sUAecTNNn7FVM,17498
90
90
  brainstate/nn/_rate_rnns.py,sha256=OQHMyq9kKd2q44dOHLuTqHKTGuraPMqXVutFP_LYIyU,20676
@@ -92,40 +92,40 @@ brainstate/nn/_rate_rnns_test.py,sha256=__hhx7e6LX_1mDLLQyIi4TNCaFAWnOVSTIgwHNjz
92
92
  brainstate/nn/_readout.py,sha256=OJjSba5Wr7dtUXqYhAv1D7BUGOI-lAmg6urxPBrZe3c,7116
93
93
  brainstate/nn/_readout_test.py,sha256=L2T0-SkiACxkY_I5Pbnbmy0Zw3tbpV3l5xVzAw42f2g,2136
94
94
  brainstate/nn/_stp.py,sha256=-ahDEqSp8bQsU_nUK4jks8fjMYKgIbO0v7zpyGVuXtA,8645
95
- brainstate/nn/_synapse.py,sha256=liKhmHZFQpEdu1R76AljeJMAKz5HK8Yq95ENa6FLVAc,20145
95
+ brainstate/nn/_synapse.py,sha256=E43DxH0PW3pa6rKn9UWkD_PxIdpMAo04Yy41gaR3KPc,19868
96
96
  brainstate/nn/_synapse_test.py,sha256=xmCWFxZUIM2YtmW5otKnADGCCK__4JpXmSYcZ3wzlQM,4994
97
97
  brainstate/nn/_synaptic_projection.py,sha256=UFgzsMB1VZ9ieumwmaTIC7irLrZ4pmwfiuOYomkwXG4,17917
98
98
  brainstate/nn/_synouts.py,sha256=jWQP1-qXFpdYgyUSJNFD7_bk4_-67ok36br-OzbcSXY,4524
99
99
  brainstate/nn/_synouts_test.py,sha256=sfjotlS--4hT22Vb5RfmpfmXABa8z-VdxZYUSocMmlU,2244
100
- brainstate/nn/_utils.py,sha256=epfELIy1COgdS9z5be-fmbFhagNugcIHpw4ww-HlkSY,3123
101
- brainstate/nn/metrics.py,sha256=TXCB_yGQzamklJCI5FGOAZ5dihtY-gjYlSi2SCLC3LA,14700
100
+ brainstate/nn/_utils.py,sha256=nmp6MRQoKJhfxkbbnZJEyhyMQ4DZh8FNN_JQsl55kHE,3130
101
+ brainstate/nn/metrics.py,sha256=kFhUZRowtk4IoBIOPbENO4KezA6ZW_AxLAVknKFiL-s,14728
102
102
  brainstate/optim/__init__.py,sha256=7Ao0LCtDNAoxSRSXiLLKnd1_4mR2GSExizpN38il-Fo,1195
103
103
  brainstate/optim/_base.py,sha256=P37k8w46iQZZZnFLa5OF83Sb8DLQfYMez9ZRObBqVsE,1835
104
104
  brainstate/optim/_lr_scheduler.py,sha256=0t7kl35MLmc0UcSu587nI28cI3SohYhy_19Al-5dNTM,15289
105
105
  brainstate/optim/_lr_scheduler_test.py,sha256=gzzd_rzgtDWzF-93mujg043jv2wO9IceXGKiIYw5_ko,1790
106
- brainstate/optim/_optax_optimizer.py,sha256=RcO5N5JO_U0P4Q82waQuwMS7yWR-oP18eUwgzXJX0EY,5274
106
+ brainstate/optim/_optax_optimizer.py,sha256=eNaHge-9URe82WvIGDGrWrAr0MAkYWe4eCsTwijJlbU,5337
107
107
  brainstate/optim/_optax_optimizer_test.py,sha256=GVcszbNxBZ4z54bS5r-zDzP8gQZl7s5IsEZEd6G2gLo,1775
108
108
  brainstate/optim/_sgd_optimizer.py,sha256=Fn4CdGaDfV4qc_4gacCcGSjit5-ZrsBbQP-KB0Ocdac,46110
109
109
  brainstate/random/__init__.py,sha256=c5q-RC3grRIjx-HBb2IhKZpi_xzbFmUUxzRAzqfREic,1045
110
- brainstate/random/_rand_funs.py,sha256=c4xiY2NeMizSslxbWOa-QJZ3h-LDfsgH4fbvBMSNLWg,137646
111
- brainstate/random/_rand_funs_test.py,sha256=G8BuxDjBSeE-Mh7KuwVk6mPQhHE0m1R5HDFljEOIdzg,20669
112
- brainstate/random/_rand_seed.py,sha256=1ZdfFZWyOhpd72EDdEDmpkp3yoLVwdv-sGI9BwiZfzI,5949
110
+ brainstate/random/_rand_funs.py,sha256=0OY5kqEVrA2im-uKW2Rown0iIy7F0u54hGXHKxAP-go,137905
111
+ brainstate/random/_rand_funs_test.py,sha256=1K6bT6hhOPhomE-AMyPpT6MtG6ewANRSb5bJSU-ysYc,20690
112
+ brainstate/random/_rand_seed.py,sha256=ROpPgopGyL2ITNWJAM25NYjTyBizUoC4LzPUX-JpTpk,5998
113
113
  brainstate/random/_rand_seed_test.py,sha256=waXXfch57X1XE1zDnCRokT6ziZOK0g-lYE80o6epDYM,1536
114
- brainstate/random/_rand_state.py,sha256=dTO7wqmuTYRdPy7ItsrK-7aNt5QQXOsZ4XwiH7mzmy8,55170
114
+ brainstate/random/_rand_state.py,sha256=hQ_govRxfIgsmtFe_V2B-jftqiMWRWrd9wkviPFOziY,55523
115
115
  brainstate/random/_random_for_unit.py,sha256=kGp4EUX19MXJ9Govoivbg8N0bddqOldKEI2h_TbdONY,2057
116
116
  brainstate/util/__init__.py,sha256=6efwr63osmqviNU_6_Nufag19PwxRDFvDAZrq6sH5yo,1555
117
- brainstate/util/_pretty_pytree_test.py,sha256=Dn0TdjX6wLBXaTD4jfYTu6cKfFHwKSxi4_3bX7kB_IA,5621
118
117
  brainstate/util/caller.py,sha256=RBRwu1HT_Lww7EE3WTjzrwwKqVWg7dn_JXKmO9ojM38,2752
119
118
  brainstate/util/error.py,sha256=GBLaU_glQlgdrjBYIMiO3Dy5N_ST6-QNsgAOa9kjUjw,1757
120
119
  brainstate/util/filter.py,sha256=skuq51y0P5-N611fQ-zB2QyaJIFqN_WbROzZHv0RgOc,14086
121
120
  brainstate/util/others.py,sha256=vGo4uW0vd7wL5DYtxKWqXhoNmI-O_p26HsucoMnhdVA,16407
122
- brainstate/util/pretty_pytree.py,sha256=HmXZpKGps1Rs0DEN7r1eYN6xMM6FgDpCC8SdEHjOsvo,33534
121
+ brainstate/util/pretty_pytree.py,sha256=ROrOO03fxq2NvsZHlz1XG7B4NhAjHXavPjh179GUwG4,33604
122
+ brainstate/util/pretty_pytree_test.py,sha256=64x2c9teehF_UoozCuuJ9WQj_287cTOTV1x58jxOTv8,5914
123
123
  brainstate/util/pretty_repr.py,sha256=7Xp7IFNUeP7cGlpvwwJyBslbQVnXEqC1I6neV1Jx1S8,10527
124
124
  brainstate/util/pretty_table.py,sha256=uJVaamFGQ4nKP8TkEGPWXHpzjMecDo2q1Ah6XtRjdPY,108117
125
125
  brainstate/util/scaling.py,sha256=U6DM-afPrLejiGqo1Nla7z4YbTBVicctsBEweurr_mk,7524
126
- brainstate/util/struct.py,sha256=7HbbQNrZ3zxYw93MU1bUZ9ZPBKftYOVKuXEochLSErw,17479
127
- brainstate-0.1.4.dist-info/LICENSE,sha256=VZe9u1jgUL2eCY6ZPOYgdb8KCblCHt8ECdbtJid6e1s,11550
128
- brainstate-0.1.4.dist-info/METADATA,sha256=EWarKpuYFIN0ITFn8lwsUy0h9-KjrVPDwcvjQMHFRto,4135
129
- brainstate-0.1.4.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
130
- brainstate-0.1.4.dist-info/top_level.txt,sha256=eQbGgKn0ptx7FDWuua0V0wr4K1VHi2iOUCYo3fUQBRA,11
131
- brainstate-0.1.4.dist-info/RECORD,,
126
+ brainstate/util/struct.py,sha256=2Y_wuDFQ6ldl_H4_w0IjzAtkbHooVgdsVbnT7Z6_Efc,17528
127
+ brainstate-0.1.6.dist-info/LICENSE,sha256=VZe9u1jgUL2eCY6ZPOYgdb8KCblCHt8ECdbtJid6e1s,11550
128
+ brainstate-0.1.6.dist-info/METADATA,sha256=PsI82NGU6Zeh18JitOiA0jnEgullQ5aA_tl4zdl4Iqw,4122
129
+ brainstate-0.1.6.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
130
+ brainstate-0.1.6.dist-info/top_level.txt,sha256=eQbGgKn0ptx7FDWuua0V0wr4K1VHi2iOUCYo3fUQBRA,11
131
+ brainstate-0.1.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any