brainx-skill 1.0.8 → 1.0.10
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.
- package/README.md +1 -6
- package/manifest.json +3 -2
- package/package.json +2 -1
- package/skills/braincell/SKILL.md +1 -1
- package/skills/braincell/references/braincell-custom-ion-channel-authoring.md +107 -44
- package/skills/braincell/references/channel-library.md +0 -85
- package/skills/braincell/references/ion-library.md +0 -67
- package/skills/braincell/references/multicompartment/filter-function-library.md +0 -8
- package/skills/braincell/references/multicompartment/topology-building-and-visualization.md +204 -65
- package/skills/brainmass/SKILL.md +290 -0
- package/skills/brainmass/references/batch-transform-acceleration.md +136 -0
- package/skills/brainmass/references/brainstate/parameter-constraints-regularization.md +214 -0
- package/skills/brainmass/references/brainstate/parameter-transforms-regularizers-catalog.md +171 -0
- package/skills/brainmass/references/braintools/cogtask.md +190 -0
- package/skills/brainmass/references/braintools/data-preprocessing.md +83 -0
- package/skills/brainmass/references/braintools/metric.md +157 -0
- package/skills/brainmass/references/braintools/optimizer.md +187 -0
- package/skills/brainmass/references/braintools/parameter-initializer.md +187 -0
- package/skills/brainmass/references/braintools/surrogate.md +151 -0
- package/skills/brainmass/references/coupling-network-api.md +148 -0
- package/skills/brainmass/references/datasets-api.md +72 -0
- package/skills/brainmass/references/fitting-with-objectives-api.md +146 -0
- package/skills/brainmass/references/forward-observation-api.md +131 -0
- package/skills/brainmass/references/horn-task-training.md +199 -0
- package/skills/brainmass/references/modellibrary.md +104 -0
- package/skills/brainmass/references/noiseprocesses.md +121 -0
- package/skills/brainmass/references/parameter-sweeps-and-regime-analysis.md +130 -0
- package/skills/brainmass/references/scripts/eeg-fitting-with-gradients.py +230 -0
- package/skills/brainmass/references/scripts/gradient-free-fitting.py +106 -0
- package/skills/brainmass/references/scripts/hopf-bifurcation-single-node.py +78 -0
- package/skills/brainmass/references/scripts/horn-cognitive-task-training.py +211 -0
- package/skills/brainmass/references/scripts/jansen-rit-eeg-proxy.py +76 -0
- package/skills/brainmass/references/scripts/kuramoto-synchronization.py +81 -0
- package/skills/brainmass/references/scripts/linear-baseline-node.py +81 -0
- package/skills/brainmass/references/scripts/resting-state-meg-whole-brain-pipeline.py +249 -0
- package/skills/brainmass/references/scripts/seizure-epileptor-case-study.py +126 -0
- package/skills/brainmass/references/scripts/wilson-cowan-ei-dynamics.py +86 -0
- package/skills/brainmass/references/scripts/wong-wang-decision-making.py +167 -0
- package/skills/brainmass/references/scripts/wong-wang-dmf-resting-state.py +72 -0
- package/skills/brainmass/references/visualization-analysis-api.md +130 -0
- package/skills/brainpy-state/SKILL.md +1 -1
- package/skills/brainx-general-guard/SKILL.md +52 -118
- package/skills/brainx-install/SKILL.md +7 -4
- package/skills/brainx-general-guard/references/brainstate-randomness-reproducibility/advanced-randomness.md +0 -303
- package/skills/brainx-general-guard/references/brainstate-randomness-reproducibility/randomness-and-reproducibility.md +0 -62
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
# Advanced BrainState RNG reference
|
|
2
|
-
|
|
3
|
-
This is a nested child with exactly one selector: `skills/brainx-general-guard/references/brainstate-randomness-reproducibility/randomness-and-reproducibility.md`. Do not route here directly from a skill, workspace router, index, transform reference, or dynamics reference. Keep the default path compact: seed once, call `brainstate.random`, and let BrainState manage keys automatically.
|
|
4
|
-
|
|
5
|
-
Official anchor phrase: `brainstate.random` provides "a comprehensive set of random number generation functions and utilities for neural network simulations and scientific computing." It includes standard random distributions, random state management with automatic key splitting, seed management utilities, and a NumPy-compatible API.
|
|
6
|
-
|
|
7
|
-
## 1. Manual key management
|
|
8
|
-
|
|
9
|
-
Official boundary: "For advanced use cases, you can directly access and manipulate keys."
|
|
10
|
-
|
|
11
|
-
Use manual keys only when the task explicitly needs current-key inspection, exact RNG restoration, or parallel key splitting.
|
|
12
|
-
|
|
13
|
-
```python
|
|
14
|
-
# Get current key
|
|
15
|
-
current_key = brainstate.random.get_key()
|
|
16
|
-
print(f"Current key: {current_key}")
|
|
17
|
-
|
|
18
|
-
# Split key for parallel operations
|
|
19
|
-
keys = brainstate.random.split_key(n=4)
|
|
20
|
-
print(f"\n Split into {len(keys)} keys:")
|
|
21
|
-
for i, key in enumerate(keys):
|
|
22
|
-
print(f" Key {i}: {key}")
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
# Save and restore state
|
|
27
|
-
saved_key = brainstate.random.get_key()
|
|
28
|
-
v1 = brainstate.random.randn(3)
|
|
29
|
-
# Generate more numbers
|
|
30
|
-
v2 = brainstate.random.randn(3)
|
|
31
|
-
|
|
32
|
-
# Restore state
|
|
33
|
-
brainstate.random.set_key(saved_key)
|
|
34
|
-
v3 = brainstate.random.randn(3)
|
|
35
|
-
|
|
36
|
-
print(f"v1: {v1}")
|
|
37
|
-
print(f"v2: {v2}")
|
|
38
|
-
print(f"v3 (restored): {v3}")
|
|
39
|
-
print(f"\n v1 == v3? {jnp.allclose(v1, v3)}")
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Related API utilities:
|
|
43
|
-
|
|
44
|
-
- `get_key`: get the current global random key.
|
|
45
|
-
- `set_key`: set a new random key for the global random state.
|
|
46
|
-
- `get_key_data`: get the current global random key as raw `uint32[2]` data.
|
|
47
|
-
- `restore_key`: restore the default random key to its previous state.
|
|
48
|
-
- `split_key`: create new random key(s) from the current seed.
|
|
49
|
-
- `split_keys`: create multiple independent random keys from the current seed.
|
|
50
|
-
- `self_assign_multi_keys`: assign multiple keys to the global random state for parallel access.
|
|
51
|
-
|
|
52
|
-
## 2. Custom `RandomState` instances / independent streams
|
|
53
|
-
|
|
54
|
-
Official boundary: "For advanced use cases, you can create custom `RandomState` instances with independent random streams."
|
|
55
|
-
|
|
56
|
-
```python
|
|
57
|
-
# Create custom random generators
|
|
58
|
-
rng1 = brainstate.random.RandomState(42)
|
|
59
|
-
rng2 = brainstate.random.RandomState(123)
|
|
60
|
-
|
|
61
|
-
print("RNG 1:")
|
|
62
|
-
print(rng1)
|
|
63
|
-
|
|
64
|
-
# Generate independent random sequences
|
|
65
|
-
samples1 = rng1.randn(5)
|
|
66
|
-
samples2 = rng2.randn(5)
|
|
67
|
-
print(f"Samples from RNG1: {samples1}")
|
|
68
|
-
print(f"Samples from RNG2: {samples2}")
|
|
69
|
-
print(f"\n Are they different? {not jnp.allclose(samples1, samples2)}")
|
|
70
|
-
|
|
71
|
-
# Re-seed custom RNG
|
|
72
|
-
rng1.seed(999)
|
|
73
|
-
samples3 = rng1.randn(5)
|
|
74
|
-
print(f"\n After re-seeding RNG1 to 999: {samples3}")
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Best-practice examples from the RNG tutorial:
|
|
78
|
-
|
|
79
|
-
```python
|
|
80
|
-
# For data augmentation
|
|
81
|
-
aug_rng = brainstate.random.RandomState(seed=123)
|
|
82
|
-
|
|
83
|
-
# For model initialization
|
|
84
|
-
init_rng = brainstate.random.RandomState(seed=456)
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## 3. Checkpoint RNG save/restore
|
|
88
|
-
|
|
89
|
-
Use this only when exact continuation of a run matters.
|
|
90
|
-
|
|
91
|
-
```python
|
|
92
|
-
# Save state
|
|
93
|
-
checkpoint = {
|
|
94
|
-
'model': model.state_dict(),
|
|
95
|
-
'rng_key': brainstate.random.get_key()
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
# Restore state
|
|
99
|
-
brainstate.random.set_key(checkpoint['rng_key'])
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## 4. Temporary seed contexts and RNG cloning
|
|
103
|
-
|
|
104
|
-
Official API phrases:
|
|
105
|
-
|
|
106
|
-
- `seed_context`: "Context manager for temporary random seed changes with automatic restoration."
|
|
107
|
-
- `default_rng`: "Get the default random state or create a new one with specified seed."
|
|
108
|
-
- `clone_rng`: "Create a clone of the random state or a new random state."
|
|
109
|
-
|
|
110
|
-
The API page’s seed-management example shows a temporary seed context as:
|
|
111
|
-
|
|
112
|
-
```python
|
|
113
|
-
>>> import brainstate.random as bsr
|
|
114
|
-
>>>
|
|
115
|
-
>>> # Set a global seed
|
|
116
|
-
>>> bsr.seed(42)
|
|
117
|
-
>>>
|
|
118
|
-
>>> # Get current seed/key
|
|
119
|
-
>>> key = bsr.get_key()
|
|
120
|
-
>>>
|
|
121
|
-
>>> # Split the key for parallel operations
|
|
122
|
-
>>> keys = bsr.split_key(n=4)
|
|
123
|
-
>>>
|
|
124
|
-
>>> # Use context manager for temporary seed
|
|
125
|
-
>>> with bsr.local_seed(123):
|
|
126
|
-
... x = bsr.normal(0, 1, (5,)) # Uses seed 123
|
|
127
|
-
>>> y = bsr.normal(0, 1, (5,)) # Uses original seed
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## 5. Full probability distribution catalog
|
|
131
|
-
|
|
132
|
-
The compact skill lists only everyday functions. Use this catalog when the user asks for specific distributions or API coverage.
|
|
133
|
-
|
|
134
|
-
### Basic random sampling
|
|
135
|
-
|
|
136
|
-
- `rand`: random values in a given shape.
|
|
137
|
-
- `randn`: sample(s) from the standard normal distribution.
|
|
138
|
-
- `random`, `random_sample`, `ranf`, `sample`: random floats in `[0.0, 1.0)`.
|
|
139
|
-
- `randint`: random integers from low inclusive to high exclusive.
|
|
140
|
-
- `random_integers`: random integers between low and high inclusive.
|
|
141
|
-
|
|
142
|
-
### Array-like generation: PyTorch compatibility
|
|
143
|
-
|
|
144
|
-
- `rand_like`: similar to `rand_like` in torch.
|
|
145
|
-
- `randint_like`: similar to `randint_like` in torch.
|
|
146
|
-
- `randn_like`: similar to `randn_like` in torch.
|
|
147
|
-
|
|
148
|
-
### Array manipulation
|
|
149
|
-
|
|
150
|
-
- `choice`: generates a random sample from a given 1-D array.
|
|
151
|
-
- `permutation`: randomly permute a sequence, or return a permuted range.
|
|
152
|
-
- `shuffle`: return a randomly shuffled copy of an array along an axis.
|
|
153
|
-
|
|
154
|
-
### Continuous distributions
|
|
155
|
-
|
|
156
|
-
- `beta`: draw samples from a Beta distribution.
|
|
157
|
-
- `exponential`, `standard_exponential`: draw samples from an exponential distribution.
|
|
158
|
-
- `gamma`, `standard_gamma`: draw samples from a Gamma distribution.
|
|
159
|
-
- `gumbel`: draw samples from a Gumbel distribution.
|
|
160
|
-
- `laplace`: draw samples from the Laplace or double exponential distribution.
|
|
161
|
-
- `logistic`: draw samples from a logistic distribution.
|
|
162
|
-
- `normal`: draw random samples from a normal/Gaussian distribution.
|
|
163
|
-
- `pareto`: draw samples from a Pareto II or Lomax distribution.
|
|
164
|
-
- `standard_cauchy`: draw samples from a standard Cauchy distribution.
|
|
165
|
-
- `standard_normal`: draw samples from a standard Normal distribution.
|
|
166
|
-
- `standard_t`: draw samples from a standard Student’s t distribution.
|
|
167
|
-
- `uniform`: draw samples from a uniform distribution.
|
|
168
|
-
- `truncated_normal`: sample truncated standard normal random values.
|
|
169
|
-
- `lognormal`, `power`, `rayleigh`, `triangular`, `vonmises`, `wald`, `weibull`, `weibull_min`, `maxwell`, `t`, `loggamma`.
|
|
170
|
-
|
|
171
|
-
### Discrete distributions
|
|
172
|
-
|
|
173
|
-
- `bernoulli`: sample Bernoulli random values with given shape and mean.
|
|
174
|
-
- `binomial`: draw samples from a binomial distribution.
|
|
175
|
-
- `categorical`: sample random values from categorical distributions.
|
|
176
|
-
- `geometric`, `hypergeometric`, `logseries`, `multinomial`, `negative_binomial`, `poisson`, `zipf`.
|
|
177
|
-
|
|
178
|
-
### Special distributions
|
|
179
|
-
|
|
180
|
-
- `chisquare`: draw samples from a chi-square distribution.
|
|
181
|
-
- `dirichlet`: draw samples from the Dirichlet distribution.
|
|
182
|
-
- `f`: draw samples from an F distribution.
|
|
183
|
-
- `multivariate_normal`: draw random samples from a multivariate normal distribution.
|
|
184
|
-
- `noncentral_chisquare`, `noncentral_f`, `orthogonal`.
|
|
185
|
-
|
|
186
|
-
## 6. Distribution visualization
|
|
187
|
-
|
|
188
|
-
Official boundary: visualization belongs in reference/tutorial material. The RNG tutorial introduces it with: "Let’s visualize several distributions."
|
|
189
|
-
|
|
190
|
-
Use the official tutorial section for histogram examples rather than placing plotting code in the compact skill.
|
|
191
|
-
|
|
192
|
-
## 7. Full practical examples from the RNG tutorial
|
|
193
|
-
|
|
194
|
-
### Mini-batch sampling
|
|
195
|
-
|
|
196
|
-
```python
|
|
197
|
-
def create_mini_batches(X, y, batch_size=32, shuffle=True):
|
|
198
|
-
"""Create mini-batches for training."""
|
|
199
|
-
n_samples = len(X)
|
|
200
|
-
|
|
201
|
-
# Shuffle indices
|
|
202
|
-
if shuffle:
|
|
203
|
-
indices = brainstate.random.permutation(n_samples)
|
|
204
|
-
else:
|
|
205
|
-
indices = jnp.arange(n_samples)
|
|
206
|
-
|
|
207
|
-
# Create batches
|
|
208
|
-
batches = []
|
|
209
|
-
for start_idx in range(0, n_samples, batch_size):
|
|
210
|
-
end_idx = min(start_idx + batch_size, n_samples)
|
|
211
|
-
batch_indices = indices[start_idx:end_idx]
|
|
212
|
-
batches.append((X[batch_indices], y[batch_indices]))
|
|
213
|
-
|
|
214
|
-
return batches
|
|
215
|
-
|
|
216
|
-
# Generate dummy dataset
|
|
217
|
-
brainstate.random.seed(0)
|
|
218
|
-
X = brainstate.random.randn(100, 10) # 100 samples, 10 features
|
|
219
|
-
y = brainstate.random.randint(0, 2, 100) # Binary labels
|
|
220
|
-
# Create mini-batches
|
|
221
|
-
batches = create_mini_batches(X, y, batch_size=32)
|
|
222
|
-
print(f"Created {len(batches)} mini-batches")
|
|
223
|
-
print(f"First batch shape: X={batches[0][0].shape}, y={batches[0][1].shape}")
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Dropout layer
|
|
227
|
-
|
|
228
|
-
```python
|
|
229
|
-
class Dropout(brainstate.nn.Module):
|
|
230
|
-
"""Dropout layer with random masking."""
|
|
231
|
-
|
|
232
|
-
def __init__(self, drop_rate=0.5):
|
|
233
|
-
super().__init__()
|
|
234
|
-
self.drop_rate = drop_rate
|
|
235
|
-
|
|
236
|
-
def __call__(self, x):
|
|
237
|
-
fit = brainstate.environ.get('fit', False)
|
|
238
|
-
if not fit:
|
|
239
|
-
return x
|
|
240
|
-
# Generate random mask
|
|
241
|
-
keep_prob = 1.0 - self.drop_rate
|
|
242
|
-
mask = brainstate.random.bernoulli(keep_prob, x.shape)
|
|
243
|
-
|
|
244
|
-
# Apply dropout and scale
|
|
245
|
-
return x * mask / keep_prob
|
|
246
|
-
|
|
247
|
-
# Test dropout
|
|
248
|
-
brainstate.random.seed(42)
|
|
249
|
-
dropout = Dropout(drop_rate=0.3)
|
|
250
|
-
|
|
251
|
-
x = jnp.ones(10)
|
|
252
|
-
y = dropout(x)
|
|
253
|
-
|
|
254
|
-
print(f"Input: {x}")
|
|
255
|
-
print(f"Output: {y}")
|
|
256
|
-
print(f"Zeros: {jnp.sum(y == 0)}/10")
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### Noisy neural network layer
|
|
260
|
-
|
|
261
|
-
```python
|
|
262
|
-
class NoisyLayer(brainstate.nn.Module):
|
|
263
|
-
"""Linear layer with Gaussian noise."""
|
|
264
|
-
|
|
265
|
-
def __init__(self, d_in, d_out, noise_std=0.1):
|
|
266
|
-
super().__init__()
|
|
267
|
-
self.noise_std = noise_std
|
|
268
|
-
|
|
269
|
-
# Parameters with noise
|
|
270
|
-
self.w = brainstate.ParamState(brainstate.random.randn(d_in, d_out) * 0.1)
|
|
271
|
-
self.b = brainstate.ParamState(jnp.zeros(d_out))
|
|
272
|
-
def __call__(self, x):
|
|
273
|
-
# Add weight noise
|
|
274
|
-
w_noisy = self.w.value + brainstate.random.normal(0, self.noise_std, self.w.value.shape)
|
|
275
|
-
|
|
276
|
-
# Forward pass
|
|
277
|
-
return x @ w_noisy + self.b.value
|
|
278
|
-
|
|
279
|
-
# Create and test
|
|
280
|
-
brainstate.random.seed(0)
|
|
281
|
-
layer = NoisyLayer(5, 3, noise_std=0.01)
|
|
282
|
-
|
|
283
|
-
x = jnp.ones(5)
|
|
284
|
-
y1 = layer(x)
|
|
285
|
-
y2 = layer(x) # Different due to noise
|
|
286
|
-
print(f"Output 1: {y1}")
|
|
287
|
-
print(f"Output 2: {y2}")
|
|
288
|
-
print(f"Difference: {y2 - y1}")
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
## 8. Reference routing for broader BrainState workflows
|
|
292
|
-
|
|
293
|
-
- Core tutorials: "define states, compose modules and layers, apply the essential transformations, and train a model."
|
|
294
|
-
- Transformations tutorials: "state-aware program transformations, from the essential `jit` / `grad` / `vmap` through advanced batching, error handling, debugging, and intermediate-representation tooling."
|
|
295
|
-
- Brain Dynamics tutorials: "neuron dynamics and numerical integration, synaptic delays, event-driven operators, and spiking neural networks."
|
|
296
|
-
|
|
297
|
-
## Official BrainX sources
|
|
298
|
-
|
|
299
|
-
- https://brainx.chaobrain.com/brainstate/tutorials/core/08_randomness.html
|
|
300
|
-
- https://brainx.chaobrain.com/brainstate/apis/random.html
|
|
301
|
-
- https://brainx.chaobrain.com/brainstate/tutorials/transformations/index.html
|
|
302
|
-
- https://brainx.chaobrain.com/brainstate/tutorials/core/index.html
|
|
303
|
-
- https://brainx.chaobrain.com/brainstate/tutorials/brain_dynamics/index.html
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# BrainState Randomness and Reproducibility Parent Reference
|
|
2
|
-
|
|
3
|
-
Use this reference when BrainState code needs random numbers, reproducible examples/tests, stochastic masks/noise, seed control, random trials, stochastic state, dropout/noise, RNG under transforms, or a decision between the default BrainState RNG path and advanced key/stream APIs.
|
|
4
|
-
|
|
5
|
-
Usually reached from primary skills only when the task actually involves randomness. Do not load this for ordinary deterministic state, module, training, or BrainCell modeling tasks.
|
|
6
|
-
|
|
7
|
-
## Parent-reference boundary
|
|
8
|
-
|
|
9
|
-
This is this skill's only first-layer randomness reference. `skills/brainx-general-guard/SKILL.md` routes here. `skills/brainx-general-guard/references/brainstate-randomness-reproducibility/advanced-randomness.md` is its nested child and has no other selection route.
|
|
10
|
-
|
|
11
|
-
Use `brainstate.random` for BrainState RNG. Official anchor phrase: it "wraps JAX’s random number generation capabilities with a stateful interface that simplifies usage while maintaining reproducibility and performance."
|
|
12
|
-
|
|
13
|
-
## Core rules
|
|
14
|
-
|
|
15
|
-
- Default path: use `brainstate.random`; BrainState uses automatic key management, so do not manually create/split `jax.random.PRNGKey` unless explicit key control is requested.
|
|
16
|
-
- Reproducibility: call `brainstate.random.seed(seed)` once at the beginning of scripts, notebooks, examples, tests, or reproducible experiments.
|
|
17
|
-
- Global state: all random functions in `brainstate.random` use a global `DEFAULT` instance of `RandomState`.
|
|
18
|
-
- Common functions only: `random`, `rand`, `randn`, `normal`, `uniform`, `randint`, `bernoulli`, `choice`, `permutation`, `shuffle`.
|
|
19
|
-
- Stochastic modules: generate masks/noise inside the stochastic call using `brainstate.random`.
|
|
20
|
-
- Train-only randomness: gate stochastic behavior with training/fit mode; for dropout-style code, use `brainstate.environ.get('fit', False)` and return the input unchanged when not fitting.
|
|
21
|
-
|
|
22
|
-
## Canonical official workflow
|
|
23
|
-
|
|
24
|
-
```python
|
|
25
|
-
import brainstate
|
|
26
|
-
|
|
27
|
-
brainstate.random.seed(0)
|
|
28
|
-
x = brainstate.random.normal(0, 1, (100,)) # Keys handled automatically
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Stochastic-module pattern
|
|
32
|
-
|
|
33
|
-
```python
|
|
34
|
-
fit = brainstate.environ.get('fit', False)
|
|
35
|
-
if not fit:
|
|
36
|
-
return x
|
|
37
|
-
|
|
38
|
-
keep_prob = 1.0 - drop_rate
|
|
39
|
-
mask = brainstate.random.bernoulli(keep_prob, x.shape)
|
|
40
|
-
return x * mask / keep_prob
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
For noisy stochastic behavior, generate noise at call time with `brainstate.random.normal(..., shape)`.
|
|
44
|
-
|
|
45
|
-
## Open the nested child `skills/brainx-general-guard/references/brainstate-randomness-reproducibility/advanced-randomness.md` for
|
|
46
|
-
|
|
47
|
-
- manual keys: `get_key`, `set_key`, `get_key_data`, `restore_key`, `split_key`, `split_keys`, `self_assign_multi_keys`
|
|
48
|
-
- custom `RandomState` instances or independent streams
|
|
49
|
-
- checkpoint RNG save/restore
|
|
50
|
-
- temporary seed contexts, `default_rng`, or `clone_rng`
|
|
51
|
-
- full probability distribution catalog
|
|
52
|
-
- PyTorch-compatible `rand_like`, `randint_like`, `randn_like`
|
|
53
|
-
- distribution visualization, mini-batch sampling, full dropout/noisy-layer examples
|
|
54
|
-
- RNG combined with transformations, parallelism, or brain-dynamics workflows
|
|
55
|
-
|
|
56
|
-
## Mirror Source URLs
|
|
57
|
-
|
|
58
|
-
- https://brainx.chaobrain.com/brainstate/tutorials/core/08_randomness.html
|
|
59
|
-
- https://brainx.chaobrain.com/brainstate/apis/random.html
|
|
60
|
-
- https://brainx.chaobrain.com/brainstate/tutorials/transformations/index.html
|
|
61
|
-
- https://brainx.chaobrain.com/brainstate/tutorials/core/index.html
|
|
62
|
-
- https://brainx.chaobrain.com/brainstate/tutorials/brain_dynamics/index.html
|