UNPKG
tfjs-tiny-yolov2
Version:
latest (0.4.0)
0.4.0
0.3.0
0.2.1
0.2.0
0.1.3
0.1.2
0.1.1
0.1.0
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
0.0.0
Tiny YOLO v2 object detection with tensorflow.js.
tfjs-tiny-yolov2
/
src
/
tinyYolov2
/
leaky.ts
9 lines
(8 loc)
•
276 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
*
as
tf
from
'@tensorflow/tfjs-core'
;
export
function
leaky
(
x: tf.Tensor4D
): tf.
Tensor4D
{
return
tf.
tidy
(
() =>
{
const
min = tf.
mul
(x, tf.
scalar
(
0.10000000149011612
))
return
tf.
add
(tf.
relu
(tf.
sub
(x, min)), min)
//return tf.maximum(x, min)
}) }