This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <Eigen/Dense> | |
#include <Eigen/Array> | |
using namespace Eigen; | |
using namespace std; | |
void sigmoid(MatrixXf& input, MatrixXf& output) | |
{ | |
output = (1+ (input.array().exp()).array()).array().inverse(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.mutable.ArrayBuffer | |
val name = """\[\d+,\d+,\d+\]""".r | |
val name2 = """\[(\d+),(\d+),\d+]""".r | |
def parseLine(line: String): ArrayBuffer[String] = { | |
val jsonstr = line.split("\t")(1) | |
val result = ArrayBuffer[String]() | |
val m = name.findAllIn(jsonstr) | |
val itemIdfArray = ArrayBuffer[Pair[Int, Int]]() | |
m.foreach(a => { val name2(item, idfnum) = a; val p: Pair[Int, Int] = Pair(item.toInt, idfnum.toInt); itemIdfArray += p; }) | |
if (itemIdfArray.length > 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val g = GraphLoader.textFile(sc, fname, a => 1.0F).withPartitioner(numVPart, numEPart).cache() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val g = GraphLoader.textFile(sc, fname, a => 1.0F).withPartitioner(numVPart, numEPart).cache() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.util.parsing.json._ | |
import org.json4s._ | |
import org.json4s.native.JsonMethods._ | |
import scala.collection.mutable.ArrayBuffer | |
def parseLine(line:String):ArrayBuffer[String]={ | |
val jsonstr = line.split("\t")(1) | |
val a=JSON.parseFull(jsonstr) | |
val result=ArrayBuffer[String]() | |
if(a!=None){ | |
val itemIdfArray = ArrayBuffer[Pair[Int,Int]]() |
NewerOlder