Comments (5)
Aw yes, the Vector{Vector}
is not quite clear :) That's why issue #7 is open! Sometimes the "ugly" is tucked away in the behind-the-scenes to allow the "beauty" to shine
from beautifulalgorithms.jl.
OK, looking at your notebook it seems that the purpose is for teaching. So in that case, I agree that it is sensible to write out the for loops and so on. It can easily be written as
for j in 1:k
w[:,j] = pdf.(Ref(MvNormal(μ[j], Σ[j])), x) * ϕ[j]
end
w = w ./ sum(w[:,j] for j in 1:k)
which I'm sure you are aware of. So I'm closing this now. Nice idea to make this repo btw.
from beautifulalgorithms.jl.
Could you elaborate on your first comment? I don't agree because the input x
is multivariate.
The EM algorithm implemented here is expanded upon in this notebook: https://htmlview.glitch.me/?https://github.com/mossr/PlutoNotebooks/blob/master/html/em_algorithm.html
Reminder that this repo is to highlight the 𝓈𝒾𝓂𝓅𝓁𝒾𝒸𝒾𝓉𝓎 and 𝒷𝑒𝒶𝓊𝓉𝓎 in these algorithms, so things like dealing in log-space for numerical reasons is somewhat out of scope. But I'm open to a PR if you can convince me that it's still beautiful ;) Same thing goes to the double for loop, which I'm not convinced it could be simplified any further without adding unnecessary confusion (again, these are for education and to display the algorithms in a simple/beautiful manner).
from beautifulalgorithms.jl.
I see so x
is a vector of vectors, that makes sense but is somewhat unexpected at least for me. :)
I'm happy to post an example implementation today or tomorrow of what I refer to.
from beautifulalgorithms.jl.
Thank you :) It's been very fun to put together—threading the line between concise, educational, correct, and general (usually at the expense of generality).
from beautifulalgorithms.jl.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beautifulalgorithms.jl.