Search in sources :

Example 1 with Push

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

the class UpdateFuncTest method testScale.

@Test
public void testScale() throws Exception {
    w2Client.update(new Push(w2Client.getMatrixId(), 3, localArray0)).get();
    UpdateFunc func = new Scale(w2Client.getMatrixId(), 3, 2.0);
    w2Client.update(func).get();
    double[] result = pull(w2Client, 3);
    assert (result.length == dim);
    for (int i = 0; i < result.length; i++) {
        Assert.assertEquals(result[i], localArray0[i] * 2.0, delta);
    }
}
Also used : CompressUpdateFunc(com.tencent.angel.ml.matrix.psf.update.enhance.CompressUpdateFunc) UpdateFunc(com.tencent.angel.ml.matrix.psf.update.enhance.UpdateFunc) Push(com.tencent.angel.ml.matrix.psf.update.Push) Test(org.junit.Test)

Example 2 with Push

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

the class UpdateFuncTest method testPut.

@Test
public void testPut() throws Exception {
    UpdateFunc func = new Push(w2Client.getMatrixId(), 3, localArray0);
    w2Client.update(func).get();
    double[] result = pull(w2Client, 3);
    assert (result.length == dim);
    for (int i = 0; i < result.length; i++) {
        Assert.assertEquals(result[i], localArray0[i], delta);
    }
}
Also used : CompressUpdateFunc(com.tencent.angel.ml.matrix.psf.update.enhance.CompressUpdateFunc) UpdateFunc(com.tencent.angel.ml.matrix.psf.update.enhance.UpdateFunc) Push(com.tencent.angel.ml.matrix.psf.update.Push) Test(org.junit.Test)

Aggregations

Push (com.tencent.angel.ml.matrix.psf.update.Push)2 CompressUpdateFunc (com.tencent.angel.ml.matrix.psf.update.enhance.CompressUpdateFunc)2 UpdateFunc (com.tencent.angel.ml.matrix.psf.update.enhance.UpdateFunc)2 Test (org.junit.Test)2