PNet.js 687 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tf = require("@tensorflow/tfjs-core");
  4. var common_1 = require("../common");
  5. var sharedLayers_1 = require("./sharedLayers");
  6. function PNet(x, params) {
  7. return tf.tidy(function () {
  8. var out = sharedLayers_1.sharedLayer(x, params, true);
  9. var conv = common_1.convLayer(out, params.conv4_1, 'valid');
  10. var max = tf.expandDims(tf.max(conv, 3), 3);
  11. var prob = tf.softmax(tf.sub(conv, max), 3);
  12. var regions = common_1.convLayer(out, params.conv4_2, 'valid');
  13. return { prob: prob, regions: regions };
  14. });
  15. }
  16. exports.PNet = PNet;
  17. //# sourceMappingURL=PNet.js.map