(exportPath)
| 201 | |
| 202 | // Functional model with two Merge layers. |
| 203 | async function exportFunctionalMergeModel(exportPath) { |
| 204 | const input1 = tfl.input({shape: [2, 5]}); |
| 205 | const input2 = tfl.input({shape: [4, 5]}); |
| 206 | const input3 = tfl.input({shape: [30]}); |
| 207 | const reshaped1 = tfl.layers.reshape({targetShape: [10]}).apply(input1); |
| 208 | const reshaped2 = tfl.layers.reshape({targetShape: [20]}).apply(input2); |
| 209 | const dense1 = tfl.layers.dense({units: 5}).apply(reshaped1); |
| 210 | const dense2 = tfl.layers.dense({units: 5}).apply(reshaped2); |
| 211 | const dense3 = tfl.layers.dense({units: 5}).apply(input3); |
| 212 | const avg = tfl.layers.average().apply([dense1, dense2]); |
| 213 | const concat = tfl.layers.concatenate({axis: -1}).apply([avg, dense3]); |
| 214 | const output = tfl.layers.dense({units: 1}).apply(concat); |
| 215 | const model = tfl.model({inputs: [input1, input2, input3], outputs: output}); |
| 216 | |
| 217 | await saveModelAndRandomInputs(model, exportPath); |
| 218 | } |
| 219 | |
| 220 | console.log(`Using tfjs-core version: ${tfc.version_core}`); |
| 221 | console.log(`Using tfjs-layers version: ${tfl.version_layers}`); |
no test coverage detected
searching dependent graphs…