Skip to content

Commit

Permalink
add S
Browse files Browse the repository at this point in the history
  • Loading branch information
MegamindHenry committed Feb 4, 2022
1 parent 6ef55d6 commit beee173
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/find_path.jl
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,12 @@ function learn_paths_rpi(

n = size(res)
ngrams_ind = make_ngrams_ind(res, n)
Shat = zeros(Float64, size(S_val))

for i in 1:n[1]
ci = ngrams_ind[i]
Shat[i,:] = sum(F_train[ci, :], dims = 1)
end

tmp, rpi = learn_paths(
data_train,
Expand All @@ -885,7 +891,7 @@ function learn_paths_rpi(
i2f,
f2i,
gold_ind = ngrams_ind,
Shat_val = nothing,
Shat_val = Shat,
check_gold_path = true,
max_t = max_t,
max_can = 1,
Expand Down Expand Up @@ -914,6 +920,7 @@ function learn_paths_rpi(
else
return res, rpi
end

end


Expand Down

0 comments on commit beee173

Please sign in to comment.