From f111767128ee9bb0f387adb61822720fd9281308 Mon Sep 17 00:00:00 2001 From: Carly Richmond <74931905+carlyrichmond@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:01:36 +0100 Subject: [PATCH] Adding additional comments to explain parameters --- model-classification-app/scripts/custom-model.js | 6 +++--- model-classification-app/scripts/transfer-learning.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/model-classification-app/scripts/custom-model.js b/model-classification-app/scripts/custom-model.js index 8366d64..de30020 100644 --- a/model-classification-app/scripts/custom-model.js +++ b/model-classification-app/scripts/custom-model.js @@ -36,9 +36,9 @@ async function run() { const NUM_EPOCHS = 10; await model.fit(singleImageTensor, labelsTensor, { - batchSize: BATCH_SIZE, - epochs: NUM_EPOCHS, - shuffle: true, + batchSize: BATCH_SIZE, // Number of samples to work through before updating the internal model parameters + epochs: NUM_EPOCHS, // Number of passes through the dataset + shuffle: true, // Shuffle data before each pass }); // Classify images diff --git a/model-classification-app/scripts/transfer-learning.js b/model-classification-app/scripts/transfer-learning.js index fb149ae..4b680d4 100644 --- a/model-classification-app/scripts/transfer-learning.js +++ b/model-classification-app/scripts/transfer-learning.js @@ -50,9 +50,9 @@ async function run() { const labelsTensor = tf.tensor2d(labels); await myTransferMobileNetModel.fit(singleImageTensor, labelsTensor, { - shuffle: true, - batchSize: 5, - epochs: 10, + shuffle: true, // Shuffle data before each pass + batchSize: 5, // Number of samples to work through before updating the internal model parameters + epochs: 10, // Number of passes through the dataset callbacks: { onEpochEnd: logProgress }, });