I need a TensorFlow-compatible Python library that provides a second-order derivative for Machine Learning CTC (Connectionist Temporal Classification) loss function.
Namely, a library that provides an implementation of the ctc_loss
function in Python API such that, in contrast to
tf.nn.ctc_loss
,
the second gradient must be calculable analytically with reasonable performance like this:
with tf.GradientTape() as tape1:
with tf.GradientTape() as tape2:
loss = ctc_loss(logits=logits, ...)
gradient = tape2.gradient(loss, sources=logits)
hessian = tape1.gradient(gradient, sources=logits)
This may be needed, for example, for the influence function.