#NEWLINE# def test_hessian_vector_product( ) : #NEWLINE# #INDENT# fun = ( lambda a : np . sum ( np . sin ( a ) ) ) #NEWLINE# a = npr . randn ( 5 ) #NEWLINE# v = npr . randn ( 5 ) #NEWLINE# H = hessian ( fun ) ( a ) #NEWLINE# check_equivalent ( np . dot ( H , v ) , hessian_vector_product ( fun ) ( a , v ) )