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();
}
}
}
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();
}
}
}
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();
}
}
}
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();
}
}
}
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();
}
}
}
Aggregations