Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function exportFunctionalMergeModel(exportPath) {
const input1 = tfl.input({shape: [2, 5]});
const input2 = tfl.input({shape: [4, 5]});
const input3 = tfl.input({shape: [30]});
const reshaped1 = tfl.layers.reshape({targetShape: [10]}).apply(input1);
const reshaped2 = tfl.layers.reshape({targetShape: [20]}).apply(input2);
const dense1 = tfl.layers.dense({units: 5}).apply(reshaped1);
const dense2 = tfl.layers.dense({units: 5}).apply(reshaped2);
const dense3 = tfl.layers.dense({units: 5}).apply(input3);
const avg = tfl.layers.average().apply([dense1, dense2]);
const concat = tfl.layers.concatenate({axis: -1}).apply([avg, dense3]);
const output = tfl.layers.dense({units: 1}).apply(concat);
const model = tfl.model({inputs: [input1, input2, input3], outputs: output});
await saveModelAndRandomInputsAndOutputs(model, exportPath);
}
async function exportFunctionalMergeModel(exportPath) {
const input1 = tfl.input({shape: [2, 5]});
const input2 = tfl.input({shape: [4, 5]});
const input3 = tfl.input({shape: [30]});
const reshaped1 = tfl.layers.reshape({targetShape: [10]}).apply(input1);
const reshaped2 = tfl.layers.reshape({targetShape: [20]}).apply(input2);
const dense1 = tfl.layers.dense({units: 5}).apply(reshaped1);
const dense2 = tfl.layers.dense({units: 5}).apply(reshaped2);
const dense3 = tfl.layers.dense({units: 5}).apply(input3);
const avg = tfl.layers.average().apply([dense1, dense2]);
const concat = tfl.layers.concatenate({axis: -1}).apply([avg, dense3]);
const output = tfl.layers.dense({units: 1}).apply(concat);
const model = tfl.model({inputs: [input1, input2, input3], outputs: output});
await saveModelAndRandomInputsAndOutputs(model, exportPath);
}