* Setter used for force stopping of LayersModel.fit() (i.e., training). * * Example: * * ```js * const model = tf.sequential(); * model.add(tf.layers.dense({units: 1, inputShape: [10]})); * model.compile({loss: 'meanSquaredError', optimizer: 'sgd'}); * const xs = tf.ones([8,
(stop: boolean)
| 1074 | * ``` |
| 1075 | */ |
| 1076 | override set stopTraining(stop: boolean) { |
| 1077 | // TODO(cais): When refactoring to remove the composition pattern happens, |
| 1078 | // remove this method overriding. |
| 1079 | if (this.model == null) { |
| 1080 | throw new ValueError( |
| 1081 | 'Cannot set the stopTraining property of a sequential model before ' + |
| 1082 | 'it is compiled.'); |
| 1083 | } |
| 1084 | this.model.stopTraining = stop; |
| 1085 | } |
| 1086 | |
| 1087 | override get stopTraining(): boolean { |
| 1088 | if (this.model == null) { |
nothing calls this directly
no outgoing calls
no test coverage detected