@Override public Vector evaluate( Vector input) { Vector discriminant = super.evaluate( input ); discriminant.plusEquals(this.bias); return discriminant; }
@Override final public Vector plus( final Vector v) { // I need to flip this so that if it the input is a dense vector, I // return a dense vector. If it's a sparse vector, then a sparse vector // is still returned. Vector result = v.clone(); result.plusEquals(this); return result; }
@Override final public Vector plus( final Vector v) { // I need to flip this so that if it the input is a dense vector, I // return a dense vector. If it's a sparse vector, then a sparse vector // is still returned. Vector result = v.clone(); result.plusEquals(this); return result; }
@Override public Vector evaluate( Vector input) { Vector discriminant = super.evaluate( input ); discriminant.plusEquals(this.bias); return discriminant; }
@Override final public Vector plus( final Vector v) { // I need to flip this so that if it the input is a dense vector, I // return a dense vector. If it's a sparse vector, then a sparse vector // is still returned. Vector result = v.clone(); result.plusEquals(this); return result; }
@Override public Vector evaluate( Vector input) { Vector discriminant = super.evaluate( input ); discriminant.plusEquals(this.bias); return discriminant; }
/** * Computes the raw (unsquashed) activation at the hidden layer for the * given input. * @param input * Input to compute the raw hidden activation of. * @return * Raw (unsquashed) activation at the hidden layer. */ protected Vector evaluateHiddenLayerActivation( Vector input ) { Vector hiddenActivation = this.inputToHiddenWeights.times( input ); hiddenActivation.plusEquals( this.inputToHiddenBiasWeights ); return hiddenActivation; }
/** * Computes the raw (unsquashed) activation at the hidden layer for the * given input. * @param input * Input to compute the raw hidden activation of. * @return * Raw (unsquashed) activation at the hidden layer. */ protected Vector evaluateHiddenLayerActivation( Vector input ) { Vector hiddenActivation = this.inputToHiddenWeights.times( input ); hiddenActivation.plusEquals( this.inputToHiddenBiasWeights ); return hiddenActivation; }
/** * Evaluates the output from the squashed hidden-layer activation. * @param squashedHiddenActivation * Squashed hidden-layer activation. * @return * Output of the neural net. */ protected Vector evaluateOutputFromSquashedHiddenLayerActivation( Vector squashedHiddenActivation ) { Vector outputActivation = this.hiddenToOutputWeights.times( squashedHiddenActivation ); outputActivation.plusEquals( this.hiddenToOutputBiasWeights ); return outputActivation; }
/** * Evaluates the output from the squashed hidden-layer activation. * @param squashedHiddenActivation * Squashed hidden-layer activation. * @return * Output of the neural net. */ protected Vector evaluateOutputFromSquashedHiddenLayerActivation( Vector squashedHiddenActivation ) { Vector outputActivation = this.hiddenToOutputWeights.times( squashedHiddenActivation ); outputActivation.plusEquals( this.hiddenToOutputBiasWeights ); return outputActivation; }
/** * Computes the raw (unsquashed) activation at the hidden layer for the * given input. * @param input * Input to compute the raw hidden activation of. * @return * Raw (unsquashed) activation at the hidden layer. */ protected Vector evaluateHiddenLayerActivation( Vector input ) { Vector hiddenActivation = this.inputToHiddenWeights.times( input ); hiddenActivation.plusEquals( this.inputToHiddenBiasWeights ); return hiddenActivation; }
/** * Evaluates the output from the squashed hidden-layer activation. * @param squashedHiddenActivation * Squashed hidden-layer activation. * @return * Output of the neural net. */ protected Vector evaluateOutputFromSquashedHiddenLayerActivation( Vector squashedHiddenActivation ) { Vector outputActivation = this.hiddenToOutputWeights.times( squashedHiddenActivation ); outputActivation.plusEquals( this.hiddenToOutputBiasWeights ); return outputActivation; }
@Override final public Vector minus( final Vector v) { // I need to flip this so that if it the input is a dense vector, I // return a dense vector. If it's a sparse vector, then a sparse vector // is still returned. Vector result = v.clone(); result.negativeEquals(); result.plusEquals(this); return result; }
@Override final public Vector minus( final Vector v) { // I need to flip this so that if it the input is a dense vector, I // return a dense vector. If it's a sparse vector, then a sparse vector // is still returned. Vector result = v.clone(); result.negativeEquals(); result.plusEquals(this); return result; }
@Override final public Vector minus( final Vector v) { // I need to flip this so that if it the input is a dense vector, I // return a dense vector. If it's a sparse vector, then a sparse vector // is still returned. Vector result = v.clone(); result.negativeEquals(); result.plusEquals(this); return result; }
public Vector evaluate( Vector input) { Vector xnm1 = this.getState(); Vector xn = A.times(xnm1); xn.plusEquals( B.times(input) ); this.setState(xn); return C.times(xn); }
public Vector evaluate( Vector input) { Vector xnm1 = this.getState(); Vector xn = A.times(xnm1); xn.plusEquals( B.times(input) ); this.setState(xn); return C.times(xn); }
public Vector evaluate( Vector input) { Vector xnm1 = this.getState(); Vector xn = A.times(xnm1); xn.plusEquals( B.times(input) ); this.setState(xn); return C.times(xn); }
@Override final protected double iterate() { Vector q = A.evaluate(residual); double alpha = delta / (residual.dotProduct(q)); x.plusEquals(residual.scale(alpha)); if (((iterationCounter + 1) % 50) == 0) { residual = rhs.minus(A.evaluate(x)); } else { residual = residual.minus(q.scale(alpha)); } delta = residual.dotProduct(residual); return delta; }
@Override final protected double iterate() { Vector q = A.evaluate(residual); double alpha = delta / (residual.dotProduct(q)); x.plusEquals(residual.scale(alpha)); if (((iterationCounter + 1) % 50) == 0) { residual = rhs.minus(A.evaluate(x)); } else { residual = residual.minus(q.scale(alpha)); } delta = residual.dotProduct(residual); return delta; }