learning_model 1.0.42 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -218,15 +218,15 @@ class LearningMobilenet {
|
|
|
218
218
|
const validationData = datasets.validationDataset.batch(this.batchSize);
|
|
219
219
|
const optimizer = tf.train.adam(this.learningRate);
|
|
220
220
|
const trainModel = yield this._createModel(optimizer);
|
|
221
|
+
const jointModel = tf.sequential();
|
|
222
|
+
jointModel.add(this.mobilenetModule);
|
|
223
|
+
jointModel.add(trainModel);
|
|
224
|
+
this.model = jointModel;
|
|
221
225
|
const history = yield trainModel.fitDataset(trainData, {
|
|
222
226
|
epochs: this.epochs,
|
|
223
227
|
validationData: validationData,
|
|
224
228
|
callbacks: customCallback
|
|
225
229
|
});
|
|
226
|
-
const jointModel = tf.sequential();
|
|
227
|
-
jointModel.add(this.mobilenetModule);
|
|
228
|
-
jointModel.add(trainModel);
|
|
229
|
-
this.model = jointModel;
|
|
230
230
|
optimizer.dispose();
|
|
231
231
|
return history;
|
|
232
232
|
}
|
|
@@ -228,15 +228,17 @@ class LearningMobilenet implements LearningInterface {
|
|
|
228
228
|
const validationData = datasets.validationDataset.batch(this.batchSize);
|
|
229
229
|
const optimizer = tf.train.adam(this.learningRate);
|
|
230
230
|
const trainModel = await this._createModel(optimizer);
|
|
231
|
+
const jointModel = tf.sequential();
|
|
232
|
+
jointModel.add(this.mobilenetModule!);
|
|
233
|
+
jointModel.add(trainModel);
|
|
234
|
+
this.model = jointModel;
|
|
235
|
+
|
|
231
236
|
const history = await trainModel.fitDataset(trainData, {
|
|
232
237
|
epochs: this.epochs,
|
|
233
238
|
validationData: validationData,
|
|
234
239
|
callbacks: customCallback
|
|
235
240
|
});
|
|
236
|
-
|
|
237
|
-
jointModel.add(this.mobilenetModule!);
|
|
238
|
-
jointModel.add(trainModel);
|
|
239
|
-
this.model = jointModel;
|
|
241
|
+
|
|
240
242
|
optimizer.dispose();
|
|
241
243
|
return history;
|
|
242
244
|
} catch (error) {
|