docs/algo/sona/deepwalk_sona.md
DeepWalk是一种重复访问已访问节点的深度优先遍历的图表示学习算法。DeepWalk算法使用随机游走(RandomWalk)的方式在图中进行节点采样,给定当前访问起始节点,从其邻居中随机采样节点作为下一个访问节点,重复此过程,直到访问序列长度满足预设条件。本算法仅包含游走部分。
0 1 0.3
2 1 0.5
3 1 0.1
3 2 0.7
4 1 0.3
其中,从左到右三列数据的意义分别为源节点ID、尾节点ID、边权值(无权情况可以为空)
tab, 空格等DISK_ONLY/MEMORY_ONLY/MEMORY_AND_DISKinput=hdfs://my-hdfs/data
output=hdfs://my-hdfs/output
source ./spark-on-angel-env.sh
$SPARK_HOME/bin/spark-submit \
--master yarn-cluster\
--conf spark.ps.instances=1 \
--conf spark.ps.cores=1 \
--conf spark.ps.jars=$SONA_ANGEL_JARS \
--conf spark.ps.memory=10g \
--name "deepwalk angel" \
--jars $SONA_SPARK_JARS \
--driver-memory 5g \
--num-executors 1 \
--executor-cores 4 \
--executor-memory 10g \
--class com.tencent.angel.spark.examples.cluster.DeepWalkExample \
../lib/spark-on-angel-examples-3.3.0.jar
input:$input output:$output \
sep:tab storageLevel:MEMORY_ONLY useBalancePartition:true \
partitionNum:4 psPartitionNum:1 walkLength:10 needReplicateEdge:true