2020-08-20 02:05:34 +02:00
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
exports.extractParamsFromWeigthMap = void 0;
|
|
|
|
const common_1 = require("../common");
|
|
|
|
function extractParamsFromWeigthMap(weightMap) {
|
2020-08-18 14:04:33 +02:00
|
|
|
const paramMappings = [];
|
2020-08-20 02:05:34 +02:00
|
|
|
const extractWeightEntry = common_1.extractWeightEntryFactory(weightMap, paramMappings);
|
2020-08-18 14:04:33 +02:00
|
|
|
function extractFcParams(prefix) {
|
|
|
|
const weights = extractWeightEntry(`${prefix}/weights`, 2);
|
|
|
|
const bias = extractWeightEntry(`${prefix}/bias`, 1);
|
|
|
|
return { weights, bias };
|
|
|
|
}
|
|
|
|
const params = {
|
|
|
|
fc: {
|
|
|
|
age: extractFcParams('fc/age'),
|
|
|
|
gender: extractFcParams('fc/gender')
|
|
|
|
}
|
|
|
|
};
|
2020-08-20 02:05:34 +02:00
|
|
|
common_1.disposeUnusedWeightTensors(weightMap, paramMappings);
|
2020-08-18 14:04:33 +02:00
|
|
|
return { params, paramMappings };
|
|
|
|
}
|
2020-08-20 02:05:34 +02:00
|
|
|
exports.extractParamsFromWeigthMap = extractParamsFromWeigthMap;
|
2020-08-18 14:04:33 +02:00
|
|
|
//# sourceMappingURL=extractParamsFromWeigthMap.js.map
|