(exportPath)
| 120 | } |
| 121 | |
| 122 | async function exportDepthwiseCNNModel(exportPath) { |
| 123 | const model = tfl.sequential(); |
| 124 | |
| 125 | // Cover depthwise 2D convoluational layer. |
| 126 | model.add(tfl.layers.depthwiseConv2d({ |
| 127 | depthMultiplier: 2, |
| 128 | kernelSize: [3, 3], |
| 129 | strides: [2, 2], |
| 130 | inputShape: [40, 40, 3], |
| 131 | padding: 'valid', |
| 132 | })); |
| 133 | model.add(tfl.layers.batchNormalization({})); |
| 134 | model.add(tfl.layers.activation({activation: 'relu'})); |
| 135 | model.add(tfl.layers.dropout({rate: 0.5})); |
| 136 | model.add(tfl.layers.maxPooling2d({poolSize: 2})); |
| 137 | model.add(tfl.layers.flatten({})); |
| 138 | model.add(tfl.layers.dense({units: 100, activation: 'softmax'})); |
| 139 | |
| 140 | await saveModelAndRandomInputs(model, exportPath); |
| 141 | } |
| 142 | |
| 143 | // SimpleRNN with embedding. |
| 144 | async function exportSimpleRNNModel(exportPath) { |
no test coverage detected
searching dependent graphs…