- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.getSquareL2Norm()
方法的一些代码示例,展示了WeightVector.getSquareL2Norm()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WeightVector.getSquareL2Norm()
方法的具体详情如下:
包路径:edu.illinois.cs.cogcomp.sl.util.WeightVector
类名称:WeightVector
方法名:getSquareL2Norm
暂无
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl-core
protected static float getDualObjective(
StructuredInstanceWithAlphas[] alphaInsList, WeightVector wv) {
float obj = 0;
obj += wv.getSquareL2Norm() * 0.5;
for (int i = 0; i < alphaInsList.length; i++) {
StructuredInstanceWithAlphas instanceWithAlphas = alphaInsList[i];
float w_sum = instanceWithAlphas.getLossWeightAlphaSum();
float sum = instanceWithAlphas.alphaSum;
float C = instanceWithAlphas.getC();
obj -= w_sum;
obj += (1.0 / (4.0 * C)) * sum * sum;
}
return obj;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl
protected static float getDualObjective(
StructuredInstanceWithAlphas[] alphaInsList, WeightVector wv) {
float obj = 0;
obj += wv.getSquareL2Norm() * 0.5;
for (int i = 0; i < alphaInsList.length; i++) {
StructuredInstanceWithAlphas instanceWithAlphas = alphaInsList[i];
float w_sum = instanceWithAlphas.getLossWeightAlphaSum();
float sum = instanceWithAlphas.alphaSum;
float C = instanceWithAlphas.getC();
obj -= w_sum;
obj += (1.0 / (4.0 * C)) * sum * sum;
}
return obj;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/IllinoisSL-core
protected static float getDualObjective(
StructuredInstanceWithAlphas[] alphaInsList, WeightVector wv) {
float obj = 0;
obj += wv.getSquareL2Norm() * 0.5;
for (int i = 0; i < alphaInsList.length; i++) {
StructuredInstanceWithAlphas instanceWithAlphas = alphaInsList[i];
float w_sum = instanceWithAlphas.getLossWeightAlphaSum();
float sum = instanceWithAlphas.getAlphaSum();
float C = instanceWithAlphas.getC();
obj -= w_sum;
obj += (1.0 / (4.0 * C)) * sum * sum;
}
return obj;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl-core
/**
* Get primal objective function value with respect to the weight vector wv
* @param sp
* @param wv
* @param infSolver
* @param C
* @return
* @throws Exception
*/
public float getPrimalObjective(
SLProblem sp, WeightVector wv,
AbstractInferenceSolver infSolver, float C) throws Exception {
float obj = 0;
obj += wv.getSquareL2Norm() * 0.5;
List<IInstance> input_list = sp.instanceList;
List<IStructure> output_list = sp.goldStructureList;
for (int i = 0; i < input_list.size(); i++) {
IInstance ins = input_list.get(i);
IStructure gold_struct = output_list.get(i);
float sC= C;
IStructure h = infSolver
.getLossAugmentedBestStructure(wv, ins, gold_struct);
float loss = infSolver.getLoss(ins, gold_struct, h)
+ this.featureGenerator.decisionValue(wv, ins, h)
- this.featureGenerator.decisionValue(wv, ins, gold_struct);
obj += sC * loss ;
}
return obj;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl
/**
* Get primal objective function value with respect to the weight vector wv
* @param sp
* @param wv
* @param infSolver
* @param C
* @return
* @throws Exception
*/
public float getPrimalObjective(
SLProblem sp, WeightVector wv,
AbstractInferenceSolver infSolver, float C) throws Exception {
float obj = 0;
obj += wv.getSquareL2Norm() * 0.5;
List<IInstance> input_list = sp.instanceList;
List<IStructure> output_list = sp.goldStructureList;
for (int i = 0; i < input_list.size(); i++) {
IInstance ins = input_list.get(i);
IStructure gold_struct = output_list.get(i);
float sC= C;
IStructure h = infSolver
.getLossAugmentedBestStructure(wv, ins, gold_struct);
float loss = infSolver.getLoss(ins, gold_struct, h)
+ this.featureGenerator.decisionValue(wv, ins, h)
- this.featureGenerator.decisionValue(wv, ins, gold_struct);
obj += sC * loss * loss;
}
return obj;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl-core
/**
* Get primal objective function value with respect to the weight vector wv
* @param sp
* @param wv
* @param infSolver
* @param C
* @return
* @throws Exception
*/
public float getPrimalObjective(
SLProblem sp, WeightVector wv,
AbstractInferenceSolver infSolver, float C) throws Exception {
float obj = 0;
obj += wv.getSquareL2Norm() * 0.5;
List<IInstance> input_list = sp.instanceList;
List<IStructure> output_list = sp.goldStructureList;
for (int i = 0; i < input_list.size(); i++) {
IInstance ins = input_list.get(i);
IStructure gold_struct = output_list.get(i);
float sC= C;
IStructure h = infSolver
.getLossAugmentedBestStructure(wv, ins, gold_struct);
float loss = infSolver.getLoss(ins, gold_struct, h)
+ this.featureGenerator.decisionValue(wv, ins, h)
- this.featureGenerator.decisionValue(wv, ins, gold_struct);
obj += sC * loss * loss;
}
return obj;
}
代码示例来源:origin: edu.illinois.cs.cogcomp/IllinoisSL-core
/**
* Get primal objective function value with respect to the weight vector wv
* @param sp
* @param wv
* @param infSolver
* @param C
* @return
* @throws Exception
*/
public static float getPrimalObjective(
StructuredProblem sp, WeightVector wv,
AbstractInferenceSolver infSolver, float C) throws Exception {
float obj = 0;
obj += wv.getSquareL2Norm() * 0.5;
List<IInstance> input_list = sp.instanceList;
List<IStructure> output_list = sp.goldStructureList;
for (int i = 0; i < input_list.size(); i++) {
IInstance ins = input_list.get(i);
IStructure gold_struct = output_list.get(i);
float sC= C;
Pair<IStructure, Float > res = infSolver
.getLossAugmentedBestStructure(wv, ins, gold_struct);
float loss = res.getSecond()
+ wv.dotProduct(res.getFirst().getFeatureVector())
- wv.dotProduct(gold_struct.getFeatureVector());
obj += sC * loss * loss;
}
return obj;
}
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.setDenseVector()方法的一些代码示例,展示了WeightVector.set
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.getInternalArray()方法的一些代码示例,展示了WeightVector.g
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.addSparseFeatureVector()方法的一些代码示例,展示了WeightVe
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.scale()方法的一些代码示例,展示了WeightVector.scale()的具体用法
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.setElement()方法的一些代码示例,展示了WeightVector.setElem
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.get()方法的一些代码示例,展示了WeightVector.get()的具体用法。这些代
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.()方法的一些代码示例,展示了WeightVector.()的具体用法。这些代码示例主要来
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.getLength()方法的一些代码示例,展示了WeightVector.getLengt
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.setExtendable()方法的一些代码示例,展示了WeightVector.setE
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.getSquareL2Norm()方法的一些代码示例,展示了WeightVector.ge
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.addDenseVector()方法的一些代码示例,展示了WeightVector.add
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.getWeightArray()方法的一些代码示例,展示了WeightVector.get
本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.dotProduct()方法的一些代码示例,展示了WeightVector.dotProd
我是一名优秀的程序员,十分优秀!