diff --git a/README.md b/README.md index 56a3971a..267550fe 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,8 @@ config = { scoped: false, // enable scoped runs // some models *may* have memory leaks, this wrapps everything in a local scope at a cost of performance // typically not needed - filter: { + videoOptimized: true, // perform additional optimizations when input is video, must be disabled for images + filter: { // note: image filters are only available in Browser environments and not in NodeJS as they require WebGL for processing enabled: true, // enable image pre-processing filters return: true, // return processed canvas imagedata in result brightness: 0, // range: -1 (darken) to 1 (lighten) @@ -432,6 +433,15 @@ For performance details, see output of `result.performance` object during runtim
1?hh(r,[1,a]):r}):i.cell.stateSize>1?[hh(r,[1,i.cell.stateSize])]:[r]})},Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),t.prototype.setFastWeightInitDuringBuild=function(e){n.prototype.setFastWeightInitDuringBuild.call(this,e),this.cell!=null&&this.cell.setFastWeightInitDuringBuild(e)},t.prototype.getConfig=function(){var e=n.prototype.getConfig.call(this),i={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};this.numConstants!=null&&(i.numConstants=this.numConstants);var r=this.cell.getConfig();return this.getClassName()===t.className&&(i.cell={className:this.cell.getClassName(),config:r}),Kt({},r,e,i)},t.fromConfig=function(e,i,r){r===void 0&&(r={});var a=i.cell,s=wn(a,r);return new e(Object.assign(i,{cell:s}))},t.className="RNN",t}(ke);y.serialization.registerClass(Ii);var Xr=function(n){Q(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t}(ke),qh=function(n){Q(t,n);function t(e){var i=n.call(this,e)||this;return i.DEFAULT_ACTIVATION="tanh",i.DEFAULT_KERNEL_INITIALIZER="glorotNormal",i.DEFAULT_RECURRENT_INITIALIZER="orthogonal",i.DEFAULT_BIAS_INITIALIZER="zeros",i.units=e.units,Nt(i.units,"units"),i.activation=Li(e.activation==null?i.DEFAULT_ACTIVATION:e.activation),i.useBias=e.useBias==null?!0:e.useBias,i.kernelInitializer=tt(e.kernelInitializer||i.DEFAULT_KERNEL_INITIALIZER),i.recurrentInitializer=tt(e.recurrentInitializer||i.DEFAULT_RECURRENT_INITIALIZER),i.biasInitializer=tt(e.biasInitializer||i.DEFAULT_BIAS_INITIALIZER),i.kernelRegularizer=nt(e.kernelRegularizer),i.recurrentRegularizer=nt(e.recurrentRegularizer),i.biasRegularizer=nt(e.biasRegularizer),i.kernelConstraint=St(e.kernelConstraint),i.recurrentConstraint=St(e.recurrentConstraint),i.biasConstraint=St(e.biasConstraint),i.dropout=Gr([1,yi([0,e.dropout==null?0:e.dropout])]),i.recurrentDropout=Gr([1,yi([0,e.recurrentDropout==null?0:e.recurrentDropout])]),i.stateSize=i.units,i.dropoutMask=null,i.recurrentDropoutMask=null,i}return t.prototype.build=function(e){e=Ye(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,i){var r=this;return y.tidy(function(){if(e=e,e.length!==2)throw new M("SimpleRNNCell expects 2 input Tensors, got "+e.length+".");var a=e[1];e=e[0];var s=i.training==null?!1:i.training;0i){s=r-i;for(var o=[],l=0;l