mirror of
https://github.com/onestardao/WFGY.git
synced 2026-04-28 11:40:07 +00:00
Create bbpf.py
This commit is contained in:
parent
240e9af68f
commit
705d6b7db2
1 changed files with 11 additions and 0 deletions
11
wfgy_sdk/bbpf.py
Normal file
11
wfgy_sdk/bbpf.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import numpy as np
|
||||
|
||||
def perturb_state(x, epsilon=0.1, num_paths=3):
|
||||
"""Return list of perturbed states"""
|
||||
return [x + np.random.normal(0, epsilon, size=x.shape) for _ in range(num_paths)]
|
||||
|
||||
def run_demo():
|
||||
x = np.array([1.0, 2.0, 3.0])
|
||||
paths = perturb_state(x)
|
||||
for i, p in enumerate(paths):
|
||||
print(f"Path {i+1}: {p}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue