|
d, a new document
|
|
G, a GO graph with training cases
|
|
nSample, the sample size
|
|
nMaxSteps, the number of maximum steps
|
2
|
initialize:
|
3
|
finalLeaves ← {}
|
4
|
finalLeavesProbs ← {}
|
5
|
for n in 1: nSamples
|
6
|
g ← initialize()
|
7
|
//Select initial GO node randomly
|
|
for s in 1: nMaxSteps:
|
8
|
T ← TempFunc(s)
|
9
|
nbrs ← G.neighbors(g)
|
10
|
g* ← q(g*|g, d)
|
|
//Sample from proposal distribution, g*∈{g, nbrs}
|
11
|
u ← uniform [0, 1]
|
12
|
if u <A ←
|
13
|
g ← g*
|
14
|
end
|
15
|
finalLeaves ← union(finalLeaves, curNode)
|
16
|
end
|
17
|
finaLeavesProbs ← calProbFromSample(finalLeaves)
|
18
|
outputs:
finalLeaves, finaLeavesProbs
|