Closed avedmala closed 2 years ago
Saw that you closed this right away. I hope the solution you discovered is what I would have recommended: Pass in math
(as in, Python's math module) through the context
argument in evaluation. The reason why this isn't built in is because you might like to choose other ways of evaluating, such as using numpy
(or another numpy-work-alike, like Jax).
Currently, the DifferentiationMapper can handle functions like math.cos or math.log.
The code block above works and it gives me -sin(x) as a result. However, EvaluationMapper cannot handle these functions. Is there a reason for not having this functionality? Would this be easy to extend on my own?