Skip to content

Commit

Permalink
Use aeppl to build the logprob
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf committed Sep 1, 2021
1 parent 789d1d7 commit 48c3b98
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 1,016 deletions.
9 changes: 4 additions & 5 deletions aehmc/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ def static_integration(
integrator: Callable,
step_size: float,
num_integration_steps: int,
direction: int = 1,
) -> Callable:
"""Generate a trajectory by integrating several times in one direction."""

directed_step_size = direction * step_size

def integrate(q_init, p_init, energy_init, energy_grad_init) -> IntegratorStateType:
def one_step(q, p, energy, energy_grad):
new_state = integrator(q, p, energy, energy_grad, directed_step_size)
def one_step(q, p, potential_energy, potential_energy_grad):
new_state = integrator(
q, p, potential_energy, potential_energy_grad, step_size
)
return new_state

[q, p, energy, energy_grad], _ = aesara.scan(
Expand Down
Loading

0 comments on commit 48c3b98

Please sign in to comment.