convLayer.js 416 B

12345678910
  1. import * as tf from '@tensorflow/tfjs-core';
  2. export function convLayer(x, params, padding, withRelu) {
  3. if (padding === void 0) { padding = 'same'; }
  4. if (withRelu === void 0) { withRelu = false; }
  5. return tf.tidy(function () {
  6. var out = tf.add(tf.conv2d(x, params.filters, [1, 1], padding), params.bias);
  7. return withRelu ? tf.relu(out) : out;
  8. });
  9. }
  10. //# sourceMappingURL=convLayer.js.map