depthwiseSeparableConv.js 459 B

1234567891011
  1. import * as tf from '@tensorflow/tfjs-core';
  2. import { leaky } from './leaky';
  3. export function depthwiseSeparableConv(x, params) {
  4. return tf.tidy(function () {
  5. var out = tf.pad(x, [[0, 0], [1, 1], [1, 1], [0, 0]]);
  6. out = tf.separableConv2d(out, params.depthwise_filter, params.pointwise_filter, [1, 1], 'valid');
  7. out = tf.add(out, params.bias);
  8. return leaky(out);
  9. });
  10. }
  11. //# sourceMappingURL=depthwiseSeparableConv.js.map