2020-08-20 02:05:34 +02:00
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
exports.extractConvParamsFactory = void 0;
|
|
|
|
const tf = require("@tensorflow/tfjs-core");
|
|
|
|
function extractConvParamsFactory(extractWeights, paramMappings) {
|
2020-08-18 14:04:33 +02:00
|
|
|
return function (channelsIn, channelsOut, filterSize, mappedPrefix) {
|
|
|
|
const filters = tf.tensor4d(extractWeights(channelsIn * channelsOut * filterSize * filterSize), [filterSize, filterSize, channelsIn, channelsOut]);
|
|
|
|
const bias = tf.tensor1d(extractWeights(channelsOut));
|
|
|
|
paramMappings.push({ paramPath: `${mappedPrefix}/filters` }, { paramPath: `${mappedPrefix}/bias` });
|
|
|
|
return { filters, bias };
|
|
|
|
};
|
|
|
|
}
|
2020-08-20 02:05:34 +02:00
|
|
|
exports.extractConvParamsFactory = extractConvParamsFactory;
|
2020-08-18 14:04:33 +02:00
|
|
|
//# sourceMappingURL=extractConvParamsFactory.js.map
|