Examples of HashSparseVector


Examples of org.fnlp.ml.types.sv.HashSparseVector

    System.out.println("原字典大小"+feature.size());
    StringFeatureAlphabet newfeat = new StringFeatureAlphabet();
    cl.factory.setDefaultFeatureAlphabet(newfeat);
    for(int i=0;i<weights.length;i++){
        TIntFloatIterator itt = weights[i].data.iterator();
        HashSparseVector ww = new HashSparseVector();
        while(itt.hasNext()){
          itt.advance();
          float v = itt.value();
          if(Math.abs(v)<1e-3f)
            continue;
          String fea = index.get(itt.key());
          int newidx = newfeat.lookupIndex(fea);
          ww.put(newidx, v);       
      }
      weights[i] = ww; 
    }
   
    newfeat.setStopIncrement(freeze);
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.