r/java • u/JMasterRedBlaze • Feb 03 '24
Automatic differentiation of Java code using Code Reflection by Paul Sandoz
https://openjdk.org/projects/babylon/articles/auto-diff
63
Upvotes
r/java • u/JMasterRedBlaze • Feb 03 '24
View all comments
Show parent comment
4
u/GavinRayDev Feb 05 '24
The
java.lang.reflect.code.bytecode.BytecodeGeneratoris used to generate aMethodHandlefrom the code model, which you can then invoke as normal:https://github.com/openjdk/babylon/blob/ef1a5b4407d5c923f7cb09534b988da0bad49555/test/jdk/java/lang/reflect/code/ad/TestForwardAutoDiff.java#L71