Examples of ScalarPM


Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

public class ScalarBO implements BilinearOperator<ScalarPM, ScalarPM, ScalarPM>{

  public ScalarPM bilinearMulti(ScalarPM r, ScalarPM s) {
    SignedValue res = SignedValue.multi(r.getValue(), s.getValue() );
    return new ScalarPM(res);
  }
View Full Code Here

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

    this.scale = scale;
  }
 
  @Override
  protected ScalarPM createNewXWeight() {
    return new ScalarPM();
  }  
View Full Code Here

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

    double logProb = scale * dt.getTransitionLogP(false);
    LogSemiring p = new LogSemiring(logProb);
   
    double val = logProb;
   
    ScalarPM r =  new ScalarPM( SignedValue.createSignedValueFromRealNumber(val) );
    moduleMultiSemiring(r, p);
   
    return r;
  }
View Full Code Here

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

 
 
  @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

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

  }
 
  @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

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

   
    double logProb = scale * dt.getTransitionLogP(false);
    LogSemiring p = new LogSemiring(logProb);
   
    double val = logProb;
    ScalarPM r =  new ScalarPM( SignedValue.createSignedValueFromRealNumber(val) );
    r.multiSemiring(p);
   
    res = new ExpectationSemiring<LogSemiring,ScalarPM>(p, r);
   
    return res;
  }
View Full Code Here

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

  }

  @Override
  protected ExpectationSemiringPM<LogSemiring, ScalarPM, ScalarPM, ScalarPM, ScalarBO>
  createNewXWeight() {
    ScalarPM s = new ScalarPM();
    ScalarPM t = new ScalarPM();
    return new ExpectationSemiringPM<LogSemiring, ScalarPM, ScalarPM, ScalarPM, ScalarBO>(s, t, pBilinearOperator);
  }
View Full Code Here

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

  }

  @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

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

    //== r
    double val = 0;//real
    if(dt.getRule()!=null){
      val = dt.getRule().getEnglish().length-dt.getRule().getArity();//length; real semiring
    }   
    ScalarPM r =  new ScalarPM( SignedValue.createSignedValueFromRealNumber(val) );
   
    //== s
    ScalarPM s = r;
   
    //== t
    ScalarPM t = pBilinearOperator.bilinearMulti(r, s);
   
    //s = p s
    s.multiSemiring(p);
   
    //t= p t
    t.multiSemiring(p);
   
    return new ExpectationSemiringPM<LogSemiring, ScalarPM, ScalarPM, ScalarPM, ScalarBO>(s, t, pBilinearOperator);
  }
View Full Code Here

Examples of joshua.discriminative.semiring_parsingv2.pmodule.ScalarPM

    //== r
    double val = 0;//real
    if(dt.getRule()!=null){
      val = dt.getRule().getEnglish().length-dt.getRule().getArity();//length; real semiring
    }   
    ScalarPM r =  new ScalarPM( SignedValue.createSignedValueFromRealNumber(val) );
   
    // r= p r
    r.multiSemiring(p);
   
    return new ExpectationSemiring<LogSemiring, ScalarPM>(p,r);
  }
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.