face-api/build/tinyYolov2/depthwiseSeparableConv.js

11 lines
453 B
JavaScript
Raw Normal View History

2020-08-20 02:10:42 +02:00
import * as tf from '@tensorflow/tfjs-core';
import { leaky } from './leaky';
export function depthwiseSeparableConv(x, params) {
2020-08-18 14:04:33 +02:00
return tf.tidy(() => {
let out = tf.pad(x, [[0, 0], [1, 1], [1, 1], [0, 0]]);
out = tf.separableConv2d(out, params.depthwise_filter, params.pointwise_filter, [1, 1], 'valid');
out = tf.add(out, params.bias);
2020-08-20 02:10:42 +02:00
return leaky(out);
2020-08-18 14:04:33 +02:00
});
}
//# sourceMappingURL=depthwiseSeparableConv.js.map