use of com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam in project angel by Tencent.
the class ComputeClosenessParam method split.
@Override
public List<PartitionUpdateParam> split() {
List<PartitionUpdateParam> params = new ArrayList<>();
List<PartitionKey> parts = PSAgentContext.get().getMatrixMetaManager().getPartitions(matrixId);
for (PartitionKey key : parts) {
params.add(new ComputeClosenessPartParam(matrixId, key, r));
}
return params;
}
use of com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam in project angel by Tencent.
the class FullUpdateParam method split.
@Override
public List<PartitionUpdateParam> split() {
List<PartitionKey> partList = PSAgentContext.get().getMatrixMetaManager().getPartitions(matrixId);
int size = partList.size();
List<PartitionUpdateParam> partParams = new ArrayList<>(size);
for (PartitionKey part : partList) {
partParams.add(new FullPartitionUpdateParam(matrixId, part, values));
}
return partParams;
}
use of com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam in project angel by Tencent.
the class MMUpdateParam method split.
@Override
public List<PartitionUpdateParam> split() {
List<PartitionKey> parts = PSAgentContext.get().getMatrixMetaManager().getPartitions(matrixId);
int size = parts.size();
List<PartitionUpdateParam> partParams = new ArrayList<PartitionUpdateParam>(size);
for (PartitionKey part : parts) {
if (Utils.withinPart(part, rowIds)) {
partParams.add(new MMPartitionUpdateParam(matrixId, part, rowIds, scalars));
}
}
if (partParams.isEmpty()) {
System.out.println("Rows must in same partition.");
}
return partParams;
}
use of com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam in project angel by Tencent.
the class AnyKeysUpdateParam method split.
@Override
public List<PartitionUpdateParam> split() {
MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);
PartitionKey[] parts = meta.getPartitionKeys();
KeyValuePart[] splits = RouterUtils.split(meta, 0, nodeIds, neighbors);
assert parts.length == splits.length;
List<PartitionUpdateParam> partParams = new ArrayList<>(parts.length);
for (int i = 0; i < parts.length; i++) {
if (splits[i] != null && splits[i].size() > 0) {
partParams.add(new GeneralPartUpdateParam(matrixId, parts[i], splits[i]));
}
}
return partParams;
}
use of com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam in project angel by Tencent.
the class IntKeysUpdateParam method split.
@Override
public List<PartitionUpdateParam> split() {
MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);
PartitionKey[] parts = meta.getPartitionKeys();
KeyValuePart[] splits = RouterUtils.split(meta, 0, nodeIds, neighbors);
assert parts.length == splits.length;
List<PartitionUpdateParam> partParams = new ArrayList<>(parts.length);
for (int i = 0; i < parts.length; i++) {
if (splits[i] != null && splits[i].size() > 0) {
partParams.add(new GeneralPartUpdateParam(matrixId, parts[i], splits[i]));
}
}
return partParams;
}
Aggregations