MCPcopy Create free account
hub / github.com/LeCAR-Lab/model-based-diffusion / update

Function update

mbd/planners/path_integral.py:130–141  ·  view source on GitHub ↗
(mu_0T, rng)

Source from the content-addressed store, hash-verified

128
129 # run reverse
130 def update(mu_0T, rng):
131 sigma = 1.0
132 mu_0t = mu_0T
133 mu_0ts = []
134 with tqdm(range(args.Nrefine - 1, 0, -1), desc="Path Integrating") as pbar:
135 for t in pbar:
136 carry_once = (t, rng, mu_0t, sigma)
137 (t, rng, mu_0t, sigma), rew = update_once(carry_once, None)
138 mu_0ts.append(mu_0t)
139 # Update the progress bar's suffix to show the current reward
140 pbar.set_postfix({"rew": f"{rew:.2e}"})
141 return mu_0ts
142
143 rng_exp, rng = jax.random.split(rng)
144 mu_0ts = update(mu_0T, rng_exp)

Callers 1

run_path_integralFunction · 0.85

Calls 1

update_onceFunction · 0.85

Tested by

no test coverage detected