Examples of backward()


Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

        /* Output results */
        int i = 0;
        VertexIdTranslate trans = engine.getVertexIdTranslate();
        TreeSet<IdFloat> top20 = Toplist.topListFloat(baseFilename, engine.numVertices(), 20);
        for(IdFloat vertexRank : top20) {
            System.out.println(++i + ": " + trans.backward(vertexRank.getVertexId()) + " = " + vertexRank.getValue());
        }
    }
}
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

        VertexIdTranslate vertexIdTranslate = this.drunkardMobEngine.getVertexIdTranslate();
        IdCount[] topForFirst = companion.getTop(firstSource, 10);

        System.out.println("Top visits from source vertex " + vertexIdTranslate.forward(firstSource) + " (internal id=" + firstSource + ")");
        for(IdCount idc : topForFirst) {
            System.out.println(vertexIdTranslate.backward(idc.id) + ": " + idc.count);
        }

        /* If local, shutdown the companion */
        if (companion instanceof DrunkardCompanion) {
            ((DrunkardCompanion) companion).close();
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

        /* Output results */
        int i = 0;
        VertexIdTranslate trans = engine.getVertexIdTranslate();
        TreeSet<IdFloat> top20 = Toplist.topListFloat(baseFilename, engine.numVertices(), 20);
        for(IdFloat vertexRank : top20) {
            System.out.println(++i + ": " + trans.backward(vertexRank.getVertexId()) + " = " + vertexRank.getValue());
        }
    }
}
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

            circle.add(vertexTrans.forward(vertex));
            ArrayList<SalsaVertex> top = csalsa.topAuthorities(20, circle);
            int j = 1;
            for(SalsaVertex sv : top) {
                int originalId = vertexTrans.backward(sv.id);
                logger.info("Top " + (j++) + " = " + originalId + " " + csalsa.namify(originalId) + " (" + sv.value + ")");
            }

        }
    }
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

                int ne = (side == LEFTSIDE ? vertex.numOutEdges() : vertex.numInEdges());
                // Compute XtX and Xty (NOTE: unweighted)
                for(int e=0; e < ne; e++) {
                    ChiEdge<Float> edge = (side == LEFTSIDE ? vertex.outEdge(e) : vertex.inEdge(e));
                    float observation = edge.getValue();
                    if (observation < 1.0) throw new RuntimeException("Had invalid observation: " + observation + " on edge " + idTranslate.backward(vertex.getId()) + "->" +
                                idTranslate.backward(edge.getVertexId()));
                    otherSideMatrix.getRow(idTranslate.backward(edge.getVertexId()), neighborLatent);

                    for(int i=0; i < D; i++) {
                        Xty.setEntry(i, Xty.getEntry(i) + neighborLatent[i] * observation);
 
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

                // Compute XtX and Xty (NOTE: unweighted)
                for(int e=0; e < ne; e++) {
                    ChiEdge<Float> edge = (side == LEFTSIDE ? vertex.outEdge(e) : vertex.inEdge(e));
                    float observation = edge.getValue();
                    if (observation < 1.0) throw new RuntimeException("Had invalid observation: " + observation + " on edge " + idTranslate.backward(vertex.getId()) + "->" +
                                idTranslate.backward(edge.getVertexId()));
                    otherSideMatrix.getRow(idTranslate.backward(edge.getVertexId()), neighborLatent);

                    for(int i=0; i < D; i++) {
                        Xty.setEntry(i, Xty.getEntry(i) + neighborLatent[i] * observation);
                        for(int j=i; j < D; j++) {
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

                for(int e=0; e < ne; e++) {
                    ChiEdge<Float> edge = (side == LEFTSIDE ? vertex.outEdge(e) : vertex.inEdge(e));
                    float observation = edge.getValue();
                    if (observation < 1.0) throw new RuntimeException("Had invalid observation: " + observation + " on edge " + idTranslate.backward(vertex.getId()) + "->" +
                                idTranslate.backward(edge.getVertexId()));
                    otherSideMatrix.getRow(idTranslate.backward(edge.getVertexId()), neighborLatent);

                    for(int i=0; i < D; i++) {
                        Xty.setEntry(i, Xty.getEntry(i) + neighborLatent[i] * observation);
                        for(int j=i; j < D; j++) {
                            XtX.setEntry(j,i, XtX.getEntry(j, i) + neighborLatent[i] * neighborLatent[j]);
 
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

                // Solve the least-squares optimization using Cholesky Decomposition
                RealVector newLatentFactor = new CholeskyDecompositionImpl(XtX).getSolver().solve(Xty);

                // Set the new latent factor for this vector
                for(int i=0; i < D; i++) {
                    thisSideMatrix.setValue(idTranslate.backward(vertex.getId()), i, newLatentFactor.getEntry(i));
                }

                if (context.isLastIteration() && side == RIGHTSIDE) {
                    /* On the last iteration - compute the RMSE error. But only for
                      vertices on the right side of the matrix, i.e vectors
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

                        double squaredError = 0;
                        for(int e=0; e < vertex.numInEdges(); e++) {
                            // Compute RMSE
                            ChiEdge<Float> edge = vertex.inEdge(e);
                            float observation = edge.getValue();
                            otherSideMatrix.getRow(idTranslate.backward(edge.getVertexId()), neighborLatent);
                            double prediction = new ArrayRealVector(neighborLatent).dotProduct(newLatentFactor);
                            squaredError += (prediction - observation) * (prediction - observation);
                        }

                        synchronized (this) {
View Full Code Here

Examples of edu.cmu.graphchi.preprocessing.VertexIdTranslate.backward()

        TreeSet<IdInt> topToBottom = Toplist.topListInt(inputFilePath,
                engine.numVertices(), engine.numVertices());

        for(IdInt walker : topToBottom) {
            float coreValue = walker.getValue();
            bw.write(trans.backward(walker.getVertexId()) + ", " + String.valueOf((int)coreValue) + "\n");
        }

        stopWriting();

        System.out.println("Vertexes Processed: " + engine.numVertices());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.