convWithBatchNorm.js 504 B

12345678910111213
  1. import * as tf from '@tensorflow/tfjs-core';
  2. import { leaky } from './leaky';
  3. export function convWithBatchNorm(x, params) {
  4. return tf.tidy(function () {
  5. var out = tf.pad(x, [[0, 0], [1, 1], [1, 1], [0, 0]]);
  6. out = tf.conv2d(out, params.conv.filters, [1, 1], 'valid');
  7. out = tf.sub(out, params.bn.sub);
  8. out = tf.mul(out, params.bn.truediv);
  9. out = tf.add(out, params.conv.bias);
  10. return leaky(out);
  11. });
  12. }
  13. //# sourceMappingURL=convWithBatchNorm.js.map