Examples of optimize()


Examples of edu.cmu.sphinx.result.LatticeOptimizer.optimize()

    public void newResult(Result result) {
        String ref = result.getReferenceText();
        if (result.isFinal() && ref != null) {
            Lattice lattice = new Lattice(result);
            LatticeOptimizer optimizer = new LatticeOptimizer(lattice);
            optimizer.optimize();          
            lattice.computeNodePosteriors(languageModelWeight);
            SausageMaker sausageMaker = new SausageMaker(lattice);
            Sausage sausage = sausageMaker.makeSausage();
            sausage.removeFillers();
               
View Full Code Here

Examples of net.sf.saxon.expr.ExpressionVisitor.optimize()

        Expression exp = ExpressionTool.make(expression, staticContext, 0, -1, 1, false);
        exp.setContainer(staticContext);
        ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
        visitor.setExecutable(getExecutable());
        exp = visitor.typeCheck(exp, Type.ITEM_TYPE);
        exp = visitor.optimize(exp, Type.ITEM_TYPE);
        SlotManager map = staticContext.getStackFrameMap();
        int numberOfExternalVariables = map.getNumberOfVariables();
        ExpressionTool.allocateSlots(exp, numberOfExternalVariables, map);
        XPathExpression xpe = new XPathExpression(this, exp);
        xpe.setStackFrameMap(map, numberOfExternalVariables);
View Full Code Here

Examples of net.sourceforge.jFuzzyLogic.optimization.OptimizationDeltaJump.optimize()

    //---
    // Optimize (using 'Delta jump optimization')
    //---
    OptimizationDeltaJump optimizationDeltaJump = new OptimizationDeltaJump(fuzzyRuleSet, errorFunction, parameterList);
    optimizationDeltaJump.setMaxIterations(20); // Number optimization of iterations
    optimizationDeltaJump.optimize(true);

    //---
    // Save optimized fuzzyRuleSet to file
    //---
    System.out.println(fuzzyRuleSet.toStringFCL());
View Full Code Here

Examples of org.antlr.analysis.DFAOptimizer.optimize()

    // The optimizer yanks out all exit branches from EBNF blocks
    // This is ok because we've already verified there are no problems
    // with the enter/exit decision
    DFAOptimizer optimizer = new DFAOptimizer(g);
    optimizer.optimize();
    FASerializer serializer = new FASerializer(g);
    DFA dfa = g.getLookaheadDFA(1);
    String result = serializer.serialize(dfa.startState);
    expecting = ".s0-'x'->:s1=>1\n";
    assertEquals(expecting, result);
View Full Code Here

Examples of org.apache.blur.thrift.generated.Blur.Iface.optimize()

  public static void main(String[] args) throws BlurException, TException, IOException {
    final String tableName = args[1];
    final int segmentCount = Integer.parseInt(args[2]);
    Iface client = BlurClient.getClient(args[0]);
    client.optimize(tableName, segmentCount);
  }
}
View Full Code Here

Examples of org.apache.commons.math.optimization.MultivariateRealOptimizer.optimize()

    Validate.notNull(function, "function");
    Validate.notNull(startPosition, "start position");
    final MultivariateRealOptimizer optimizer = new NelderMead();
    final MultivariateRealFunction commonsFunction = CommonsMathWrapper.wrapMultivariate(function);
    try {
      return new DoubleMatrix1D(CommonsMathWrapper.unwrap(optimizer.optimize(commonsFunction, MINIMIZER, startPosition.getData())));
    } catch (final ConvergenceException e) {
      throw new MathException(e);
    } catch (final FunctionEvaluationException e) {
      throw new MathException(e);
    }
View Full Code Here

Examples of org.apache.commons.math.optimization.UnivariateRealOptimizer.optimize()

        } catch (IllegalStateException ise) {
            // expected
        } catch (Exception e) {
            fail("wrong exception caught");
        }
        assertEquals(3 * Math.PI / 2, minimizer.optimize(f, GoalType.MINIMIZE, 4, 5), 70 * minimizer.getAbsoluteAccuracy());
        assertTrue(minimizer.getIterationCount() <= 50);
        assertEquals(3 * Math.PI / 2, minimizer.optimize(f, GoalType.MINIMIZE, 1, 5), 70 * minimizer.getAbsoluteAccuracy());
        assertTrue(minimizer.getIterationCount() <= 50);
        assertTrue(minimizer.getEvaluations()    <= 100);
        assertTrue(minimizer.getEvaluations()    >=  90);
View Full Code Here

Examples of org.apache.commons.math.optimization.direct.MultiDirectional.optimize()

    Validate.notNull(f, "function");
    Validate.notNull(initialPoint, "initial point");
    final MultivariateRealOptimizer optimizer = new MultiDirectional();
    final MultivariateRealFunction commons = CommonsMathWrapper.wrapMultivariate(f);
    try {
      return new DoubleMatrix1D(CommonsMathWrapper.unwrap(optimizer.optimize(commons, MINIMIZER, initialPoint.getData())));
    } catch (final ConvergenceException e) {
      throw new MathException(e);
    } catch (final FunctionEvaluationException e) {
      throw new MathException(e);
    }
View Full Code Here

Examples of org.apache.commons.math.optimization.direct.NelderMead.optimize()

    if(method.equals("Nelder-Mead")) {

      NelderMead optimizer = new NelderMead();
      try {
        RealPointValuePair res = optimizer.optimize(g, GoalType.MINIMIZE, par.toDoubleArray());
        ListVector.Builder result = new ListVector.Builder();
        result.add(new DoubleArrayVector(res.getPoint()));
        result.add(new DoubleArrayVector(res.getValue()));
        result.add(new IntArrayVector(IntVector.NA, IntVector.NA));
        result.add(new IntArrayVector(0));
View Full Code Here

Examples of org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer.optimize()

        optimizer.setOrthoTolerance(CONVERGENCE);
       
        // Function optimization
        VectorialPointValuePair optimum;
       
        optimum = optimizer.optimize(function, targets, weights, FIRST_GUESS);
       
        // Covariances and errors
        logger.debug("Fit: Calculate errors and covariances.");
        double[]   fitErrors     = optimizer.guessParametersErrors();
        double[][] fitCovariance = optimizer.getCovariances();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.