(yTrue: Tensor, yPred: Tensor)
| 191 | } |
| 192 | |
| 193 | export function binaryCrossentropy(yTrue: Tensor, yPred: Tensor): Tensor { |
| 194 | return tidy(() => { |
| 195 | let y: Tensor; |
| 196 | y = tfc.clipByValue(yPred, epsilon(), 1 - epsilon()); |
| 197 | y = tfc.log(tfc.div(y, tfc.sub(1, y))); |
| 198 | return tfc.mean(sigmoidCrossEntropyWithLogits(yTrue, y), -1); |
| 199 | }); |
| 200 | } |
| 201 | |
| 202 | export function kullbackLeiblerDivergence( |
| 203 | yTrue: Tensor, yPred: Tensor): Tensor { |
nothing calls this directly
no test coverage detected
searching dependent graphs…