@tensorflow/tfjs-layers
Advanced tools
Comparing version 0.7.3 to 0.7.4
@@ -75,3 +75,4 @@ import * as tfc from '@tensorflow/tfjs-core'; | ||
history: History; | ||
stopTraining: boolean; | ||
private stopTraining_; | ||
private isTraining; | ||
metrics: string[] | { | ||
@@ -108,3 +109,4 @@ [outputName: string]: string; | ||
protected getNamedWeights(config?: io.SaveConfig): NamedTensorMap; | ||
stopTraining: boolean; | ||
save(handlerOrURL: io.IOHandler | string, config?: io.SaveConfig): Promise<io.SaveResult>; | ||
} |
@@ -349,3 +349,5 @@ "use strict"; | ||
function Model(config) { | ||
return _super.call(this, config) || this; | ||
var _this = _super.call(this, config) || this; | ||
_this.isTraining = false; | ||
return _this; | ||
} | ||
@@ -780,3 +782,3 @@ Model.prototype.summary = function (lineLength, positions, printFn) { | ||
_a.sent(); | ||
this.stopTraining = false; | ||
this.stopTraining_ = false; | ||
_loop_4 = function (epoch) { | ||
@@ -840,3 +842,3 @@ var epochLogs, epochIndexArray1D_1, batches_1, _loop_5, batchIndex, state_3; | ||
logs_1.disposeTensorsInLogs(batchLogs); | ||
if (this_1.stopTraining) { | ||
if (this_1.stopTraining_) { | ||
return [2, "break"]; | ||
@@ -867,3 +869,3 @@ } | ||
_a.sent(); | ||
if (this_1.stopTraining) { | ||
if (this_1.stopTraining_) { | ||
return [2, "break"]; | ||
@@ -996,2 +998,6 @@ } | ||
case 0: | ||
if (this.isTraining) { | ||
throw new Error('Cannot start training because another fit() call is ongoing.'); | ||
} | ||
this.isTraining = true; | ||
batchSize = config.batchSize == null ? 32 : config.batchSize; | ||
@@ -1105,2 +1111,3 @@ standardizedOuts = this.standardizeUserData(x, y, false, batchSize); | ||
} | ||
this.isTraining = false; | ||
return [2, out]; | ||
@@ -1124,2 +1131,9 @@ } | ||
}; | ||
Object.defineProperty(Model.prototype, "stopTraining", { | ||
set: function (stop) { | ||
this.stopTraining_ = stop; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Model.prototype.save = function (handlerOrURL, config) { | ||
@@ -1126,0 +1140,0 @@ return __awaiter(this, void 0, void 0, function () { |
@@ -46,3 +46,4 @@ import { io, Scalar, serialization, Tensor } from '@tensorflow/tfjs-core'; | ||
static fromConfig<T extends serialization.Serializable>(cls: serialization.SerializableConstructor<T>, config: serialization.ConfigDict): T; | ||
stopTraining: boolean; | ||
getConfig(): any; | ||
} |
@@ -383,2 +383,9 @@ "use strict"; | ||
}; | ||
Object.defineProperty(Sequential.prototype, "stopTraining", { | ||
set: function (stop) { | ||
this.model.stopTraining = stop; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Sequential.prototype.getConfig = function () { | ||
@@ -385,0 +392,0 @@ var config = []; |
@@ -32,5 +32,7 @@ "use strict"; | ||
checkShapesMatch(this.val, newVal); | ||
this.val.assign(newVal); | ||
if (this.constraint != null) { | ||
this.val.assign(this.constraint.apply(this.val)); | ||
if (this.val.id !== newVal.id) { | ||
this.val.assign(newVal); | ||
if (this.constraint != null) { | ||
this.val.assign(this.constraint.apply(this.val)); | ||
} | ||
} | ||
@@ -37,0 +39,0 @@ return this; |
@@ -1,2 +0,2 @@ | ||
declare const version = "0.7.3"; | ||
declare const version = "0.7.4"; | ||
export { version }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var version = '0.7.3'; | ||
var version = '0.7.4'; | ||
exports.version = version; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@tensorflow/tfjs-layers", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "TensorFlow layers API in JavaScript", | ||
@@ -13,3 +13,3 @@ "private": false, | ||
"devDependencies": { | ||
"@tensorflow/tfjs-core": "~0.12.10", | ||
"@tensorflow/tfjs-core": "~0.12.11", | ||
"@types/jasmine": "~2.5.53", | ||
@@ -49,4 +49,4 @@ "clang-format": "~1.2.2", | ||
"peerDependencies": { | ||
"@tensorflow/tfjs-core": "~0.12.10" | ||
"@tensorflow/tfjs-core": "~0.12.11" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5506823
26657