mirror of
https://github.com/onestardao/WFGY.git
synced 2026-05-01 21:11:11 +00:00
Update example_03_chaos_mode.py
This commit is contained in:
parent
24f2a34681
commit
ecad664a93
1 changed files with 8 additions and 14 deletions
|
|
@ -1,19 +1,13 @@
|
|||
# example_03_chaos_mode.py
|
||||
# Exaggerated noise / γ to test stability limits
|
||||
# examples/example_03_chaos_mode.py
|
||||
import numpy as np, wfgy_sdk as w
|
||||
rng = np.random.default_rng(3)
|
||||
|
||||
engine = w.get_engine(reload=True) # fresh state
|
||||
eng = w.get_engine(reload=True)
|
||||
eng.gamma = 0.9
|
||||
|
||||
I, G = np.random.randn(256), np.random.randn(256)
|
||||
logits = np.random.randn(4096)
|
||||
G = rng.normal(size=256); G /= np.linalg.norm(G)
|
||||
I = G + rng.normal(scale=0.1, size=256) # larger noise
|
||||
logits = rng.normal(size=8192)
|
||||
|
||||
# Temporarily tweak parameters
|
||||
engine.gamma = 0.9 # stronger attenuation
|
||||
state = engine.run(
|
||||
input_vec=I,
|
||||
ground_vec=G,
|
||||
logits=logits,
|
||||
window_size=7, # local variance mode
|
||||
return_all=True
|
||||
)
|
||||
state = eng.run(input_vec=I, ground_vec=G, logits=logits, return_all=True)
|
||||
print(f"Chaos mode — ‖B‖={state['B_norm']:.3f} | f_S={state['f_S']:.3f}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue