convWithBatchNorm.js 628 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tf = require("@tensorflow/tfjs-core");
  4. var leaky_1 = require("./leaky");
  5. function convWithBatchNorm(x, params) {
  6. return tf.tidy(function () {
  7. var out = tf.pad(x, [[0, 0], [1, 1], [1, 1], [0, 0]]);
  8. out = tf.conv2d(out, params.conv.filters, [1, 1], 'valid');
  9. out = tf.sub(out, params.bn.sub);
  10. out = tf.mul(out, params.bn.truediv);
  11. out = tf.add(out, params.conv.bias);
  12. return leaky_1.leaky(out);
  13. });
  14. }
  15. exports.convWithBatchNorm = convWithBatchNorm;
  16. //# sourceMappingURL=convWithBatchNorm.js.map