/** * Gets the performance, which is the cost of the minimizer on the last * iteration. * * @return The performance of the algorithm. */ public NamedValue<Double> getPerformance() { Double performance = (this.getAlgorithm().getResult() != null) ? this.getAlgorithm().getResult().getSecond() : null; return new DefaultNamedValue<Double>( "cost", performance ); } }
/** * Gets the performance, which is the cost of the minimizer on the last * iteration. * * @return The performance of the algorithm. */ public NamedValue<Double> getPerformance() { Double performance = (this.getAlgorithm().getResult() != null) ? this.getAlgorithm().getResult().getSecond() : null; return new DefaultNamedValue<Double>( "cost", performance ); } }
/** * Gets the performance, which is the cost of the minimizer on the last * iteration. * * @return The performance of the algorithm. */ public NamedValue<Double> getPerformance() { Double performance = (this.getAlgorithm().getResult() != null) ? this.getAlgorithm().getResult().getSecond() : null; return new DefaultNamedValue<Double>( "cost", performance ); } }
@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(); }