org.datavec.api.writable.Writable.toInt()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(91)

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

Writable.toInt介绍

暂无

代码示例

代码示例来源:origin: org.datavec/datavec-spark

@Override
  public int compare(List<Writable> o1, List<Writable> o2) {
    return Integer.compare(o1.get(1).toInt(), o2.get(1).toInt());
  }
});

代码示例来源:origin: org.datavec/datavec-spark

@Override
  public int compare(List<Writable> o1, List<Writable> o2) {
    return Integer.compare(o1.get(1).toInt(), o2.get(1).toInt());
  }
});

代码示例来源:origin: org.datavec/datavec-spark_2.11

@Override
  public int compare(List<Writable> o1, List<Writable> o2) {
    return Integer.compare(o1.get(1).toInt(), o2.get(1).toInt());
  }
});

代码示例来源:origin: org.datavec/datavec-spark_2.11

@Override
  public int compare(List<Writable> o1, List<Writable> o2) {
    return Integer.compare(o1.get(1).toInt(), o2.get(1).toInt());
  }
});

代码示例来源:origin: org.datavec/datavec-spark

break;
case Integer:
  values[i + 2] = step.get(i).toInt();
  break;
case Long:

代码示例来源:origin: org.datavec/datavec-spark_2.11

break;
case Integer:
  values[i + 2] = step.get(i).toInt();
  break;
case Long:

代码示例来源:origin: org.datavec/datavec-hadoop

switch (convertTextTo) {
  case Byte:
    newWritable = new ByteWritable((byte) writable.toInt());
    break;
  case Double:
    break;
  case Int:
    newWritable = new IntWritable(writable.toInt());
    break;
  case Long:

代码示例来源:origin: org.datavec/datavec-spark_2.11

break;
case Integer:
  values[i] = v1.get(i).toInt();
  break;
case Long:

代码示例来源:origin: org.datavec/datavec-spark

break;
case Integer:
  values[i] = v1.get(i).toInt();
  break;
case Long:

代码示例来源:origin: org.datavec/datavec-spark_2.11

@Override
public IntegerAnalysisCounter add(Writable writable) {
  int value = writable.toInt();
  if (value == 0)
    countZero++;
  if (value == getMinValueSeen())
    countMinValue++;
  else if (value < getMinValueSeen()) {
    countMinValue = 1;
  }
  if (value == getMaxValueSeen())
    countMaxValue++;
  else if (value > getMaxValueSeen()) {
    countMaxValue = 1;
  }
  if (value >= 0) {
    countPositive++;
  } else {
    countNegative++;
  } ;
  counter.merge((double) value);
  return this;
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-datavec-iterators

int classIdx = w.toInt();
  if (classIdx >= details.oneHotNumClasses) {
    throw new IllegalStateException("Cannot convert sequence writables to one-hot: class index " + classIdx
        "indexed, thus only values 0 to nClasses-1 are valid)");
  arr.putScalar(i, w.toInt(), 1.0);
} else {

代码示例来源:origin: org.deeplearning4j/deeplearning4j-core

int classIdx = w.toInt();
  if (classIdx >= details.oneHotNumClasses) {
    throw new DL4JException("Cannot convert sequence writables to one-hot: class index " + classIdx
            + " >= numClass (" + details.oneHotNumClasses + ")");
  arr.putScalar(i, w.toInt(), 1.0);
} else {

代码示例来源:origin: org.datavec/datavec-spark

@Override
public IntegerAnalysisCounter add(Writable writable) {
  int value = writable.toInt();
  if (value == 0)
    countZero++;
  if (value == getMinValueSeen())
    countMinValue++;
  else if (value < getMinValueSeen()) {
    countMinValue = 1;
  }
  if (value == getMaxValueSeen())
    countMaxValue++;
  else if (value > getMaxValueSeen()) {
    countMaxValue = 1;
  }
  if (value >= 0) {
    countPositive++;
  } else {
    countNegative++;
  } ;
  counter.merge((double) value);
  return this;
}

代码示例来源:origin: org.deeplearning4j/deeplearning4j-datavec-iterators

w = iter.next();
int classIdx = w.toInt();
if (classIdx >= details.oneHotNumClasses) {
  throw new IllegalStateException("Cannot convert sequence writables to one-hot: class index " + classIdx

代码示例来源:origin: org.deeplearning4j/deeplearning4j-core

w = iter.next();
int classIdx = w.toInt();
if (classIdx >= details.oneHotNumClasses) {
  throw new DL4JException("Cannot convert sequence writables to one-hot: class index " + classIdx

相关文章