-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you have any assumed versions of library for Julia? #44
Comments
This is a good idea. I'll mention the versions in the Julia appendix. |
I have a question along the same lines: In the section on State Uncertainty, specifically the Particle Filter variations, a function called ''SetCategorical'' is used, for which I somehow seem to be unable to find any package or documentation online. Could you please point me to a resource, if there is any online? |
Ah, we created this. I'll insert in the appendix tomorrow, but the code looks like this: struct SetCategorical{S}
elements::Vector{S} # Set elements (could be repeated)
distr::Categorical # Categorical distribution over set elements
function SetCategorical(elements::AbstractVector{S}) where S
weights = ones(length(elements))
return new{S}(elements, Categorical(normalize(weights, 1)))
end
function SetCategorical(elements::AbstractVector{S}, weights::AbstractVector{Float64}) where S
ℓ₁ = norm(weights,1)
if ℓ₁ < 1e-6 || isinf(ℓ₁)
return SetCategorical(elements)
end
distr = Categorical(normalize(weights, 1))
return new{S}(elements, distr)
end
end
Distributions.rand(D::SetCategorical) = D.elements[rand(D.distr)]
Distributions.rand(D::SetCategorical, n::Int) = D.elements[rand(D.distr, n)]
function Distributions.pdf(D::SetCategorical, x)
sum(e == x ? w : 0.0 for (e,w) in zip(D.elements, D.distr.p))
end |
Thank you very much for the quick response, impressive. I hope you don't mind me asking two more things to double checkon this: |
The POMDP struct is used in the very next algorithm (Alg. 19.2). It shows up as the |
I think SetCategorical would adhere to the API of |
Thank you for the answer. I see that makes sense now, especially with the |
Ah! Got it. There are some kinds of problems that made additional assumptions about the model (e.g., that the dynamics are linear Gaussian). We first see something like this in Alg. 7.11. For these other kids of problems, we just assume that |
Sorry to bother again. I fully well appreciate your time for getting back to me and do not want to bother you. I am not coming from a Julia background and looking through the functions and understanding them is a way for me to see how things work. I do not expect you to make changes caused by the feedback and questions I pose, I rather see this as the documentation of a field test what someone from a different programming background might stumble across. Please let me know whether this is helpful or just a nuisance and whether I should continue, move to a new Issue, change the format or just stop. It appears that function A similar confusion overcame me when looking at the Thank you for taking the time to even read the comments, I genuinely appreciate it. |
It does appear that the For Alg 20.5, the findmax will return the maximum and the maximum element of |
Thank you for the information, I look forward to the updates. The returns of |
Ah, the two argument version of findmax with the first argument being a function is given in Appendix G.5. That second argument is a collection. This will appear in Julia 1.7. |
Do you assume any specific versions of libraries (e.g., LightGraphs.jl) for this book to run codes?
This question happens when I read and run programs on Sec 3.5.
As noted in Appendix G, codes in the PDF are compatible with Julia 1.5, but others are not mentioned.
The current LightGraphs.jl in my environment is v1.3.5, and the function name is topological_sort_by_dfs, but LigtGraphs.jl repository seems to update the function now for the next version of LightGraphs.jl. I guess the next version have the function topological_sort.
I suggest putting the version of assumed libraries in Appendix for increasing the reproducibility.
The text was updated successfully, but these errors were encountered: