mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-09 09:52:34 +01:00
make weight param modifiable
This commit is contained in:
parent
021053aaee
commit
d7c7c29730
1 changed files with 3 additions and 2 deletions
|
|
@ -68,16 +68,17 @@ TCAD.constraints.ConstantWrapper = function(constr, mask) {
|
|||
/** @constructor */
|
||||
TCAD.constraints.Weighted = function(constr, weight) {
|
||||
|
||||
this.weight = weight;
|
||||
this.params = constr.params;
|
||||
|
||||
this.error = function() {
|
||||
return constr.error() * weight;
|
||||
return constr.error() * this.weight;
|
||||
};
|
||||
|
||||
this.gradient = function(out) {
|
||||
constr.gradient(out);
|
||||
for (var i = 0; i < out.length; i++) {
|
||||
out[i] *= weight;
|
||||
out[i] *= this.weight;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue