(
yTrue: Tensor, yPred: Tensor)
| 54 | } |
| 55 | |
| 56 | export function meanSquaredLogarithmicError( |
| 57 | yTrue: Tensor, yPred: Tensor): Tensor { |
| 58 | return tidy(() => { |
| 59 | const clippedPred = tfc.clipByValue(yPred, epsilon(), Number.MAX_VALUE); |
| 60 | const firstLog = tfc.log(tfc.add(1, clippedPred)); |
| 61 | |
| 62 | const clippedTrue = tfc.clipByValue(yTrue, epsilon(), Number.MAX_VALUE); |
| 63 | const secondLog = tfc.log(tfc.add(1, clippedTrue)); |
| 64 | |
| 65 | return tfc.mean(K.square(tfc.sub(firstLog, secondLog)), -1); |
| 66 | }); |
| 67 | } |
| 68 | |
| 69 | export function squaredHinge(yTrue: Tensor, yPred: Tensor): Tensor { |
| 70 | return tidy(() => { |
nothing calls this directly
no test coverage detected
searching dependent graphs…