Skip to content
Discussion options

You must be logged in to vote

For computing gradients in a template expression you could use the D operator? https://ai.damtp.cam.ac.uk/pysr/examples/#13-using-differential-operators

eval_grad_tree_array is not set up to work with template expressions. You could either use D within the template expression body (recommended) or, for advanced usage, you could use ForwardDiff (or Zygote/Mooncake/Enzyme) to compute a derivative of eval_tree_array directly.

In any case, it's probably a good idea to throw an error for both cases (much appreciated if you could post a dedicated issue for this, to help us track things)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@yejinkim-repo
Comment options

@MilesCranmer
Comment options

Answer selected by yejinkim-repo
@yejinkim-repo
Comment options

@MilesCranmer
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants