@@ -42,6 +42,9 @@ fmltc.TrainMoreDialog = function(
4242 this . backdrop = document . getElementsByClassName ( 'modal-backdrop' ) [ 0 ] ;
4343 this . xButton = document . getElementById ( 'tmXButton' ) ;
4444 this . closeButton = document . getElementById ( 'tmCloseButton' ) ;
45+ this . advanced = document . getElementById ( 'tmAdvanced' ) ;
46+ this . advancedUpDown = document . getElementById ( 'tmAdvancedUpDown' ) ;
47+ this . advancedDiv = document . getElementById ( 'tmAdvancedDiv' ) ;
4548 this . maxRunningMinutesInput = document . getElementById ( 'tmMaxRunningMinutesInput' ) ;
4649 this . remainingTrainingMinutesSpan = document . getElementById ( 'tmRemainingTrainingMinutesSpan' ) ;
4750 this . numTrainingStepsInput = document . getElementById ( 'tmNumTrainingStepsInput' ) ;
@@ -57,14 +60,16 @@ fmltc.TrainMoreDialog = function(
5760
5861 this . startTrainingInProgress = false ;
5962
63+ this . advancedDiv . style . display = 'none' ;
64+ this . advancedUpDown . textContent = '▼' ; // down
6065 this . maxRunningMinutesInput . min = Math . min ( 10 , remainingTrainingMinutes ) ;
6166 this . maxRunningMinutesInput . max = remainingTrainingMinutes ;
62- this . maxRunningMinutesInput . value = Math . min ( 60 , remainingTrainingMinutes ) ;
67+ this . maxRunningMinutesInput . value = remainingTrainingMinutes ;
6368
6469 this . numTrainingStepsInput . min = this . util . modelTrainerData [ 'min_training_steps' ] ;
6570 this . numTrainingStepsInput . max = this . util . modelTrainerData [ 'max_training_steps' ] ;
6671 this . numTrainingStepsInput . value = this . util . modelTrainerData [ 'default_training_steps' ] ;
67- this . updateHelpfulText ( )
72+ this . updateHelpfulText ( ) ;
6873
6974 // Create checkboxes for the datasets. Omit the datasets that are already part of this model.
7075 this . datasetsHeaderDiv . style . display = 'none' ;
@@ -99,6 +104,7 @@ fmltc.TrainMoreDialog = function(
99104
100105 this . xButton . onclick = this . closeButton . onclick = this . closeButton_onclick . bind ( this ) ;
101106 this . numTrainingStepsInput . onchange = this . numTrainingStepsInput_onchange . bind ( this ) ;
107+ this . advanced . onclick = this . advanced_onclick . bind ( this ) ;
102108 this . maxRunningMinutesInput . onchange = this . maxRunningMinutesInput_onchange . bind ( this ) ;
103109 this . descriptionInput . oninput = this . descriptionInput_oninput . bind ( this ) ;
104110 this . startButton . onclick = this . startButton_onclick . bind ( this ) ;
@@ -144,7 +150,11 @@ fmltc.TrainMoreDialog.prototype.updateHelpfulText = function() {
144150 'It will take ' + info . stepsPerEpoch + ' steps to perform one full cycle through your training data. This is called an epoch.' ;
145151
146152 document . getElementById ( 'tmNumEpochs' ) . textContent =
147- '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.' ;
148158} ;
149159
150160fmltc . TrainMoreDialog . prototype . getTrainingInfo = function ( ) {
@@ -161,13 +171,17 @@ fmltc.TrainMoreDialog.prototype.getTrainingInfo = function() {
161171 const stepsPerEpoch = Math . ceil ( trainFrameCount / batchSize ) ;
162172 const numSteps = this . numTrainingStepsInput . value ;
163173 const numEpochs = Math . floor ( numSteps * batchSize / trainFrameCount ) ;
174+ const estimateMinutes = Math . ceil ( numSteps / 60 ) ;
175+ const maxMinutes = this . maxRunningMinutesInput . value ;
164176 return {
165177 'oneDataset' : oneDataset ,
166178 'trainFrameCount' : trainFrameCount ,
167179 'batchSize' : batchSize ,
168180 'stepsPerEpoch' : stepsPerEpoch ,
169181 'numEpochs' : numEpochs ,
170182 'numSteps' : numSteps ,
183+ 'estimateMinutes' : estimateMinutes ,
184+ 'maxMinutes' : maxMinutes ,
171185 } ;
172186} ;
173187
@@ -177,8 +191,19 @@ fmltc.TrainMoreDialog.prototype.numTrainingStepsInput_onchange = function() {
177191 this . updateStartButton ( ) ;
178192} ;
179193
194+ fmltc . TrainMoreDialog . prototype . advanced_onclick = function ( ) {
195+ if ( this . advancedDiv . style . display == 'none' ) {
196+ this . advancedDiv . style . display = 'block' ;
197+ this . advancedUpDown . textContent = '▲' ; // up
198+ } else {
199+ this . advancedDiv . style . display = 'none' ;
200+ this . advancedUpDown . textContent = '▼' ; // down
201+ }
202+ } ;
203+
180204fmltc . TrainMoreDialog . prototype . maxRunningMinutesInput_onchange = function ( ) {
181205 this . maxRunningMinutesInput . value = Math . max ( this . maxRunningMinutesInput . min , Math . min ( this . maxRunningMinutesInput . value , this . maxRunningMinutesInput . max ) ) ;
206+ this . updateHelpfulText ( ) ;
182207 this . updateStartButton ( ) ;
183208} ;
184209
0 commit comments