Package joshua.discriminative.semiring_parsingv2.applications.min_risk_da

Examples of joshua.discriminative.semiring_parsingv2.applications.min_risk_da.RiskAndEntropyPM


      logGradient.multiLogNumber(logTransitionProb);
     
      gradientsMap.put(featID, logGradient);
    }
   
    return new SparseMap(gradientsMap);
  }
View Full Code Here


  @Override
  protected ExpectationSemiring<LogSemiring, RiskAndEntropyPM>
 
  createNewKWeight() {   
    LogSemiring p = new LogSemiring();
    RiskAndEntropyPM r = new RiskAndEntropyPM();
    return new ExpectationSemiring<LogSemiring, RiskAndEntropyPM>( p, r );
  }
View Full Code Here

 
  getEdgeKWeight(HyperEdge dt, HGNode parentItem) {   
   
    //== p
    double logProb = getFeatureForest().getEdgeLogTransitionProb(dt, parentItem);
    LogSemiring p = new LogSemiring(logProb);
   
    //== r
    double rRisk = getFeatureForest().getEdgeRisk(dt);
    double rEntropy =  logProb;//log(p_e)
    double rMixed = rRisk + this.getTemperature() * rEntropy; //the objective is risk - T * entropy
 
View Full Code Here

    return new ScalarPM();
  }  

  @Override
  protected LogSemiring createNewKWeight() {
    return new LogSemiring();
  }
View Full Code Here

  }

  @Override
  protected LogSemiring getEdgeKWeight(HyperEdge dt, HGNode parent_item) {
    double logProb = scale * dt.getTransitionLogP(false);
    return  new LogSemiring(logProb);   
  }
View Full Code Here

  }

  @Override
  protected ScalarPM getEdgeXWeight(HyperEdge dt, HGNode parent_item) {
    double logProb = scale * dt.getTransitionLogP(false);
    LogSemiring p = new LogSemiring(logProb);
   
    double val = logProb;
   
    ScalarPM r =  new ScalarPM( SignedValue.createSignedValueFromRealNumber(val) );
    moduleMultiSemiring(r, p);
View Full Code Here

 
 
  @Override
  public void normalizeGoal() {
    LogSemiring goalKVal = getGoalK();
    ScalarPM goalX = getGoalX();
   
    //goalKVal.printInfor();
    //goalXVal.printInfor();
   
    double normConstant = goalKVal.getLogValue();//p
    goalX.getValue().multiLogNumber(-normConstant);//r
   
  }
View Full Code Here

    this.scale = scale_;
  }
 
  @Override
  protected ExpectationSemiring<LogSemiring, ScalarPM> createNewKWeight() {
    LogSemiring p = new LogSemiring();
    ScalarPM r = new ScalarPM();
    return new ExpectationSemiring<LogSemiring,ScalarPM>(p, r);
  }
View Full Code Here

  @Override
  protected ExpectationSemiring<LogSemiring, ScalarPM> getEdgeKWeight(HyperEdge dt, HGNode parent_item) {
    ExpectationSemiring<LogSemiring,ScalarPM> res = null;
   
    double logProb = scale * dt.getTransitionLogP(false);
    LogSemiring p = new LogSemiring(logProb);
   
    double val = logProb;
    ScalarPM r =  new ScalarPM( SignedValue.createSignedValueFromRealNumber(val) );
    r.multiSemiring(p);
   
View Full Code Here

    return new ExpectationSemiringPM<LogSemiring, ScalarPM, ScalarPM, ScalarPM, ScalarBO>(s, t, pBilinearOperator);
  }

  @Override
  protected ExpectationSemiring<LogSemiring, ScalarPM> createNewKWeight() {
    LogSemiring p = new LogSemiring();
    ScalarPM s = new ScalarPM();
    return new ExpectationSemiring<LogSemiring, ScalarPM>(p,s);
  }
View Full Code Here

TOP

Related Classes of joshua.discriminative.semiring_parsingv2.applications.min_risk_da.RiskAndEntropyPM

Copyright © 2018 www.massapicom. 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.