jitting through wrapper #12408
Unanswered
SaitejaUtpala
asked this question in
Q&A
Replies: 1 comment
-
Sorry for the slow response here – I find it hard to understand what you are asking. Can you provide some actual minimal code and timings that show what slowdown you're seeing? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
let
cost
be real-valued function takes two arguments, call itparams, data
.now computing gradient wrt
params
would amountNow, assume that I have to build a new type of gradient called
new_type_grad
, where after computing a gradient of functioncost
, there is transformation calledtransform
parametrized by againparams
(first argument ofcost
) that transformsgrad
.So,so I need to develop a higher order function
new_type_grad
that would automaically do as above, i.e.,Further I should be able to
jit
thenew_type_grad
( just we would jit thegrad
)Here is the first approach I thought
key problem is that
(jit(new_type_grad))(cost)
is significantly slower than justnew_type_grad(cost)
. Any better approach?Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions