Search in sources :

Example 1 with PartIncrementRowsParam

use of com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam in project angel by Tencent.

the class MyIncrement method partitionUpdate.

@Override
public void partitionUpdate(PartitionUpdateParam partParam) {
    PartIncrementRowsParam param = (PartIncrementRowsParam) partParam;
    List<RowUpdateSplit> updates = param.getUpdates();
    for (RowUpdateSplit update : updates) {
        ServerRow row = psContext.getMatrixStorageManager().getRow(param.getPartKey(), update.getRowId());
        row.startWrite();
        try {
            Vector vector = getVector(param.getMatrixId(), update.getRowId(), param.getPartKey());
            vector.iadd(update.getVector());
        } finally {
            row.endWrite();
        }
    }
}
Also used : PartIncrementRowsParam(com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow) Vector(com.tencent.angel.ml.math2.vector.Vector)

Example 2 with PartIncrementRowsParam

use of com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam in project angel by Tencent.

the class Min method partitionUpdate.

@Override
public void partitionUpdate(PartitionUpdateParam partParam) {
    PartIncrementRowsParam param = (PartIncrementRowsParam) partParam;
    List<RowUpdateSplit> updates = param.getUpdates();
    for (RowUpdateSplit update : updates) {
        ServerRow row = psContext.getMatrixStorageManager().getRow(param.getPartKey(), update.getRowId());
        row.startWrite();
        try {
            Vector vector = getVector(param.getMatrixId(), update.getRowId(), param.getPartKey());
            Ufuncs.imin(vector, update.getVector());
        } finally {
            row.endWrite();
        }
    }
}
Also used : PartIncrementRowsParam(com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow) Vector(com.tencent.angel.ml.math2.vector.Vector)

Example 3 with PartIncrementRowsParam

use of com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam in project angel by Tencent.

the class Max method partitionUpdate.

@Override
public void partitionUpdate(PartitionUpdateParam partParam) {
    PartIncrementRowsParam param = (PartIncrementRowsParam) partParam;
    List<RowUpdateSplit> updates = param.getUpdates();
    for (RowUpdateSplit update : updates) {
        ServerRow row = psContext.getMatrixStorageManager().getRow(param.getPartKey(), update.getRowId());
        row.startWrite();
        try {
            Vector vector = getVector(param.getMatrixId(), update.getRowId(), param.getPartKey());
            Ufuncs.imax(vector, update.getVector());
        } finally {
            row.endWrite();
        }
    }
}
Also used : PartIncrementRowsParam(com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow) Vector(com.tencent.angel.ml.math2.vector.Vector)

Example 4 with PartIncrementRowsParam

use of com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam in project angel by Tencent.

the class Sub method partitionUpdate.

@Override
public void partitionUpdate(PartitionUpdateParam partParam) {
    PartIncrementRowsParam param = (PartIncrementRowsParam) partParam;
    List<RowUpdateSplit> updates = param.getUpdates();
    for (RowUpdateSplit update : updates) {
        ServerRow row = psContext.getMatrixStorageManager().getRow(param.getPartKey(), update.getRowId());
        row.startWrite();
        try {
            Vector vector = getVector(param.getMatrixId(), update.getRowId(), param.getPartKey());
            vector.isub(update.getVector());
        } finally {
            row.endWrite();
        }
    }
}
Also used : PartIncrementRowsParam(com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow) Vector(com.tencent.angel.ml.math2.vector.Vector)

Example 5 with PartIncrementRowsParam

use of com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam in project angel by Tencent.

the class Add method partitionUpdate.

@Override
public void partitionUpdate(PartitionUpdateParam partParam) {
    PartIncrementRowsParam param = (PartIncrementRowsParam) partParam;
    List<RowUpdateSplit> updates = param.getUpdates();
    for (RowUpdateSplit update : updates) {
        ServerRow row = psContext.getMatrixStorageManager().getRow(param.getPartKey(), update.getRowId());
        row.startWrite();
        try {
            Vector vector = getVector(param.getMatrixId(), update.getRowId(), param.getPartKey());
            vector.iadd(update.getVector());
        } finally {
            row.endWrite();
        }
    }
}
Also used : PartIncrementRowsParam(com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow) Vector(com.tencent.angel.ml.math2.vector.Vector)

Aggregations

Vector (com.tencent.angel.ml.math2.vector.Vector)5 PartIncrementRowsParam (com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam)5 ServerRow (com.tencent.angel.ps.storage.vector.ServerRow)5 RowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit)5