(yTrue, yPred)
| 22 | import * as utils from './utils'; |
| 23 | |
| 24 | function falsePositives(yTrue, yPred) { |
| 25 | return tf.tidy(() => { |
| 26 | const one = tf.scalar(1); |
| 27 | const zero = tf.scalar(0); |
| 28 | return tf.logicalAnd(yTrue.equal(zero), yPred.equal(one)) |
| 29 | .sum() |
| 30 | .cast('float32'); |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | function trueNegatives(yTrue, yPred) { |
| 35 | return tf.tidy(() => { |