Search in sources :

Example 11 with PSModel

use of com.tencent.angel.ml.model.PSModel in project angel by Tencent.

the class GBDTController method pushHistogram.

private void pushHistogram(int nid, int bytesPerItem) {
    String histParaName = this.param.gradHistNamePrefix + nid;
    PSModel histMat = this.model.getPSModel(histParaName);
    try {
        if (bytesPerItem == 8) {
            histMat.increment(0, this.histCache[nid]);
        } else {
            QuantifyDoubleFunc func = new QuantifyDoubleFunc(histMat.getMatrixId(), 0, this.histCache[nid], bytesPerItem * 8);
            histMat.update(func);
        }
    } catch (Exception e) {
        LOG.error(histParaName + " increment failed, ", e);
    }
}
Also used : PSModel(com.tencent.angel.ml.model.PSModel) QuantifyDoubleFunc(com.tencent.angel.ml.psf.compress.QuantifyDoubleFunc)

Aggregations

PSModel (com.tencent.angel.ml.model.PSModel)11 IntDoubleVector (com.tencent.angel.ml.math2.vector.IntDoubleVector)7 IntDoubleDenseVectorStorage (com.tencent.angel.ml.math2.storage.IntDoubleDenseVectorStorage)4 IntIntVector (com.tencent.angel.ml.math2.vector.IntIntVector)4 IntIntDenseVectorStorage (com.tencent.angel.ml.math2.storage.IntIntDenseVectorStorage)2 AngelException (com.tencent.angel.exception.AngelException)1 RegTree (com.tencent.angel.ml.GBDT.algo.RegTree)1 SplitEntry (com.tencent.angel.ml.GBDT.algo.tree.SplitEntry)1 GBDTGradHistGetRowFunc (com.tencent.angel.ml.GBDT.psf.GBDTGradHistGetRowFunc)1 HistAggrParam (com.tencent.angel.ml.GBDT.psf.HistAggrParam)1 IntDoubleSparseVectorStorage (com.tencent.angel.ml.math2.storage.IntDoubleSparseVectorStorage)1 MatrixContext (com.tencent.angel.ml.matrix.MatrixContext)1 QuantifyDoubleFunc (com.tencent.angel.ml.psf.compress.QuantifyDoubleFunc)1 MatrixSaveContext (com.tencent.angel.model.MatrixSaveContext)1 ModelSaveContext (com.tencent.angel.model.ModelSaveContext)1 RowIdColIdValueTextRowFormat (com.tencent.angel.model.output.format.RowIdColIdValueTextRowFormat)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1