def _theano_energy_function(H, q, **theano_kwargs):
 p = tt.dvector('p')
 p.tag.test_value = q.tag.test_value
 total_energy = (H.pot.energy(p) - H.logp(q))
 energy_function = theano.function(inputs=[q, p], outputs=total_energy, **theano_kwargs)
 energy_function.trust_input = True
 return (energy_function, p)

def _theano_energy_function ( H , q , ** theano_kwargs ) : p = tt . dvector ( 'p' ) p . tag . test_value = q . tag . test_value total_energy = ( H . pot . energy ( p ) - H . logp ( q ) ) energy_function = theano . function ( inputs = [ q , p ] , outputs = total_energy , ** theano_kwargs ) energy_function . trust_input = True return ( energy_function , p )
creates a hamiltonian with shared inputs .