gpt4 book ai didi

edu.illinois.cs.cogcomp.sl.util.WeightVector.getInternalArray()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 04:53:05 26 4
gpt4 key购买 nike

本文整理了Java中edu.illinois.cs.cogcomp.sl.util.WeightVector.getInternalArray()方法的一些代码示例,展示了WeightVector.getInternalArray()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WeightVector.getInternalArray()方法的具体详情如下:
包路径:edu.illinois.cs.cogcomp.sl.util.WeightVector
类名称:WeightVector
方法名:getInternalArray

WeightVector.getInternalArray介绍

暂无

代码示例

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl-core

/**
 * Duplicate a weight vector
 * @param wv
 */
public WeightVector(WeightVector wv) {
  float in[] = wv.getInternalArray();
  u =  new float[in.length];
  System.arraycopy(in, 0, u, 0, in.length);
  size = in.length;
}

代码示例来源:origin: edu.illinois.cs.cogcomp/IllinoisSL-core

/**
 * Duplicate a weight vector
 * @param in
 */
public WeightVector(WeightVector wv) {
  float in[] = wv.getInternalArray();
  u =  new float[in.length];
  System.arraycopy(in, 0, u, 0, in.length);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl

/**
 * Duplicate a weight vector
 * @param in
 */
public WeightVector(WeightVector wv) {
  float in[] = wv.getInternalArray();
  u =  new float[in.length];
  System.arraycopy(in, 0, u, 0, in.length);
  size = in.length;
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl

@Override
public void run(WeightVector w, AbstractInferenceSolver inference)
    throws Exception {
  float [] array = new float[w.getInternalArray().length];
  for(int i=0 ;i< array.length;i++)
    array[i] = w.getInternalArray()[i];
    
  WeightVector wv = new WeightVector(array);
  wvList.add(wv);
  runningTime.add(System.currentTimeMillis() - startTime);
}
public void postEvaluation(SLProblem sp, AbstractInferenceSolver infSolver) throws Exception{

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl

public static void printSparsity(WeightVector wv) {
  int nzeroes=0;
  System.out.println("SIZE: "+wv.getLength());
  for(float f:wv.getInternalArray())
  {
    if(f!=0.0)
      nzeroes++;
  }
  System.out.println("NZ values: "+nzeroes);
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl-core

public void printToFile(Lexiconer lm, String filepath) throws FileNotFoundException {
  float[] ff= this.getInternalArray();
  PrintWriter w = new PrintWriter(filepath);
  for(int i=0;i<ff.length;i++)
  {
    w.println(lm.getFeatureString(i)+" "+ff[i]);
  }
  w.close();
}
public static WeightVector readFromFile(Lexiconer lm, String filepath) throws IOException {

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl

public void printToFile(Lexiconer lm, String filepath) throws FileNotFoundException {
  float[] ff= this.getInternalArray();
  PrintWriter w = new PrintWriter(filepath);
  for(int i=0;i<ff.length;i++)
  {
    w.println(lm.getFeatureString(i)+" "+ff[i]);
  }
  w.close();
}
public static WeightVector readFromFile(Lexiconer lm, String filepath) throws FileNotFoundException {

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-sl-core

public static void printSparsity(WeightVector wv) {
  int nzeroes=0;
  System.out.println("SIZE: "+wv.getLength());
  for(float f:wv.getInternalArray())
  {
    if(f!=0.0)
      nzeroes++;
  }
  System.out.println("NZ values: "+nzeroes);
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com