@SuppressWarnings("unchecked") public ResultType learn( Collection<? extends InputOutputPair<? extends Vector, Vector>> data ) { this.getCostFunction().setCostParameters( data ); this.setResult( (ResultType) this.getObjectToOptimize().clone() ); Vector parameters = this.getResult().convertToVector(); this.getAlgorithm().setInitialGuess( parameters ); EvaluatorType internalFunction = this.createInternalFunction(); InputOutputPair<Vector,Double> bestParameters = this.getAlgorithm().learn( internalFunction ); this.getResult().convertFromVector( bestParameters.getInput() ); return this.getResult(); }
@SuppressWarnings("unchecked") public ResultType learn( Collection<? extends InputOutputPair<? extends Vector, Vector>> data ) { this.getCostFunction().setCostParameters( data ); this.setResult( (ResultType) this.getObjectToOptimize().clone() ); Vector parameters = this.getResult().convertToVector(); this.getAlgorithm().setInitialGuess( parameters ); EvaluatorType internalFunction = this.createInternalFunction(); InputOutputPair<Vector,Double> bestParameters = this.getAlgorithm().learn( internalFunction ); this.getResult().convertFromVector( bestParameters.getInput() ); return this.getResult(); }
@SuppressWarnings("unchecked") public ResultType learn( Collection<? extends InputOutputPair<? extends Vector, Vector>> data ) { this.getCostFunction().setCostParameters( data ); this.setResult( (ResultType) this.getObjectToOptimize().clone() ); Vector parameters = this.getResult().convertToVector(); this.getAlgorithm().setInitialGuess( parameters ); EvaluatorType internalFunction = this.createInternalFunction(); InputOutputPair<Vector,Double> bestParameters = this.getAlgorithm().learn( internalFunction ); this.getResult().convertFromVector( bestParameters.getInput() ); return this.getResult(); }