-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRun_Node_Prediction.jl
61 lines (35 loc) · 1.02 KB
/
Run_Node_Prediction.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
include("API.jl")
include("Config.jl")
graph = build_graph("
fox animal likes dog animal
fox animal neutral human mammal
fox animal dislikes cat animal
dog animal likes fox animal
dog animal likes human mammal
dog animal dislikes cat animal
human mammal likes dog animal
human mammal neutral fox animal
human mammal likes cat animal
cat animal likes human mammal
cat animal dislikes dog animal
cat animal dislikes fox animal
")
question_graph = build_graph("
fox animal likes X animal
X animal likes fox animal
X animal likes human mammal
human mammal likes X animal
X animal dislikes cat animal
cat animal dislikes X animal
human mammal neutral fox animal
human mammal likes cat animal
")
@show test_for_node_prediction(graph)
for i in 1:hm_epochs
println("train: $(train_for_node_prediction!(graph, learning_rate))")
i%test_per_epoch == 0 ? println("\ttest: $(test_for_node_prediction(graph))") : ()
end
println(" ")
# predict_node(graph, question_graph)
# embed_node(graph, "fox")
# display_similarities(graph)