Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Commit d7be35a

Browse files
committed
Added text at bottom of start training (and train more) dialog box that says
"This training job will take approximately <estimate> minutes, but will be stopped if it runs longer than <max> minutes."
1 parent 92bb84c commit d7be35a

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

server/src/js/startTrainingDialog.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ fmltc.StartTrainingDialog.prototype.updateHelpfulText = function() {
124124
'It will take ' + info.stepsPerEpoch + ' steps to perform one full cycle through your training data. This is called an epoch.';
125125

126126
document.getElementById('stNumEpochs').textContent =
127-
'Training for ' + info.numSteps + ' steps will perform ' + info.numEpochs + ' epochs.'
127+
'Training for ' + info.numSteps + ' steps will perform ' + info.numEpochs + ' epochs.';
128+
129+
document.getElementById('stTimeInfo').textContent =
130+
'This training job will take approximately ' + info.estimateMinutes +
131+
' minutes, but will be stopped if it runs longer than ' + info.maxMinutes + ' minutes.';
128132
};
129133

130134
fmltc.StartTrainingDialog.prototype.getTrainingInfo = function() {
@@ -135,13 +139,17 @@ fmltc.StartTrainingDialog.prototype.getTrainingInfo = function() {
135139
const stepsPerEpoch = Math.ceil(trainFrameCount / batchSize);
136140
const numSteps = this.numTrainingStepsInput.value;
137141
const numEpochs = Math.floor(numSteps * batchSize / trainFrameCount);
142+
const estimateMinutes = Math.ceil(numSteps / 60);
143+
const maxMinutes = this.maxRunningMinutesInput.value;
138144
return {
139145
'oneDataset': oneDataset,
140146
'trainFrameCount': trainFrameCount,
141147
'batchSize': batchSize,
142148
'stepsPerEpoch': stepsPerEpoch,
143149
'numEpochs': numEpochs,
144150
'numSteps': numSteps,
151+
'estimateMinutes': estimateMinutes,
152+
'maxMinutes': maxMinutes,
145153
};
146154
};
147155

@@ -163,6 +171,7 @@ fmltc.StartTrainingDialog.prototype.advanced_onclick = function() {
163171

164172
fmltc.StartTrainingDialog.prototype.maxRunningMinutesInput_onchange = function() {
165173
this.maxRunningMinutesInput.value = Math.max(this.maxRunningMinutesInput.min, Math.min(this.maxRunningMinutesInput.value, this.maxRunningMinutesInput.max));
174+
this.updateHelpfulText();
166175
this.updateStartButton();
167176
};
168177

server/src/js/trainMoreDialog.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ fmltc.TrainMoreDialog.prototype.updateHelpfulText = function() {
150150
'It will take ' + info.stepsPerEpoch + ' steps to perform one full cycle through your training data. This is called an epoch.';
151151

152152
document.getElementById('tmNumEpochs').textContent =
153-
'Training for ' + info.numSteps + ' steps will perform ' + info.numEpochs + ' epochs.'
153+
'Training for ' + info.numSteps + ' steps will perform ' + info.numEpochs + ' epochs.';
154+
155+
document.getElementById('tmTimeInfo').textContent =
156+
'This training job will take approximately ' + info.estimateMinutes +
157+
' minutes, but will be stopped if it runs longer than ' + info.maxMinutes + ' minutes.';
154158
};
155159

156160
fmltc.TrainMoreDialog.prototype.getTrainingInfo = function() {
@@ -167,13 +171,17 @@ fmltc.TrainMoreDialog.prototype.getTrainingInfo = function() {
167171
const stepsPerEpoch = Math.ceil(trainFrameCount / batchSize);
168172
const numSteps = this.numTrainingStepsInput.value;
169173
const numEpochs = Math.floor(numSteps * batchSize / trainFrameCount);
174+
const estimateMinutes = Math.ceil(numSteps / 60);
175+
const maxMinutes = this.maxRunningMinutesInput.value;
170176
return {
171177
'oneDataset': oneDataset,
172178
'trainFrameCount': trainFrameCount,
173179
'batchSize': batchSize,
174180
'stepsPerEpoch': stepsPerEpoch,
175181
'numEpochs': numEpochs,
176182
'numSteps': numSteps,
183+
'estimateMinutes': estimateMinutes,
184+
'maxMinutes': maxMinutes,
177185
};
178186
};
179187

@@ -195,6 +203,7 @@ fmltc.TrainMoreDialog.prototype.advanced_onclick = function() {
195203

196204
fmltc.TrainMoreDialog.prototype.maxRunningMinutesInput_onchange = function() {
197205
this.maxRunningMinutesInput.value = Math.max(this.maxRunningMinutesInput.min, Math.min(this.maxRunningMinutesInput.value, this.maxRunningMinutesInput.max));
206+
this.updateHelpfulText();
198207
this.updateStartButton();
199208
};
200209

server/templates/root.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ <h5 class="modal-title">Start Training</h5>
430430
<div class="text-14" id="stEpochInfo"></div>
431431
<div class="text-14" id="stNumEpochs"></div>
432432
<br>
433+
<div class="text-14" id="stTimeInfo"></div>
434+
<br>
433435
<button id="stStartButton" class="btn btn-secondary">Start Training</button>
434436
<br>
435437
<div id="stInProgressDiv" class="text-16" style="display: none;">Submitting job request...</div>
@@ -501,6 +503,8 @@ <h5 class="modal-title">Train More</h5>
501503
<div class="text-14" id="tmEpochInfo"></div>
502504
<div class="text-14" id="tmNumEpochs"></div>
503505
<br>
506+
<div class="text-14" id="tmTimeInfo"></div>
507+
<br>
504508
<button id="tmStartButton" class="btn btn-secondary">Start Training</button>
505509
<br>
506510
<div id="tmInProgressDiv" class="text-16" style="display: none;">Submitting job request...</div>

0 commit comments

Comments
 (0)