convLayer.js 515 B

12345678910111213
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tf = require("@tensorflow/tfjs-core");
  4. function convLayer(x, params, padding, withRelu) {
  5. if (padding === void 0) { padding = 'same'; }
  6. if (withRelu === void 0) { withRelu = false; }
  7. return tf.tidy(function () {
  8. var out = tf.add(tf.conv2d(x, params.filters, [1, 1], padding), params.bias);
  9. return withRelu ? tf.relu(out) : out;
  10. });
  11. }
  12. exports.convLayer = convLayer;
  13. //# sourceMappingURL=convLayer.js.map