(yTrue, yPred)
| 32 | } |
| 33 | |
| 34 | function trueNegatives(yTrue, yPred) { |
| 35 | return tf.tidy(() => { |
| 36 | const zero = tf.scalar(0); |
| 37 | return tf.logicalAnd(yTrue.equal(zero), yPred.equal(zero)) |
| 38 | .sum() |
| 39 | .cast('float32'); |
| 40 | }); |
| 41 | } |
| 42 | |
| 43 | // TODO(cais): Use tf.metrics.falsePositiveRate when available. |
| 44 | function falsePositiveRate(yTrue, yPred) { |