589 points · by samuel246 · 4y ago · 99 comments
> In this course, we’ll be looking for the following trifecta: (i) ideas that are non-obvious, even to the well-trained computer scientist, so that we’re not wasting your time; (ii) conceptually simple — realistically, these are the only ideas that you might remember a year or more from now, when you’re a start-up founder, senior software engineer, PhD student, etc. (iii) fundamental, meaning that there is some chance that the idea will prove useful to you in the future.
In the first lesson, they discuss consistent hashing, and they seem to have achieved their goals.
ETA: Must include this anecdote on the history of the algorithm:
1. 1997: The implementation of consistent hashing given in this lecture first appeared in a research paper in STOC (“Symposium on the Theory of Computing”) [...] Ironically, the paper had previously been rejected from a theoretical computer science conference because at least one reviewer felt that “it had no hope of being practical.”
2. 1998: Akamai is founded.
3. March 31, 1999: A trailer for “Star Wars: The Phantom Menace” is released online, with Apple the exclusive official distributor. apple.com goes down almost immediately due to the overwhelming number of download requests. For a good part of the day, the only place to watch (an unauthorized copy?) of the trailer is via Akamai’s Web caches. This put Akamai on the map.
4. April 1, 1999: Steve Jobs, having noticed Akamai’s performance the day before, calls Akamai’s President Paul Sagan to talk. Sagan hangs up on Jobs, thinking it’s an April Fool’s prank by one of the co-founders, Danny Lewin or Tom Leighton.
https://www.amazon.com/Alex-Xu/e/B08BNMFT7P/
He also has a cheap online course ($60 a year) that covers everything that’s in the books:
https://bytebytego.com/pricing
* note: not affiliated with him, YouTube suggested his videos and I looked into him.
What happened to the relationship between Apple and Akamai?
> [The algorithm (Consistent Hashing)] has real applications [and] gave birth to Akamai, which to this day is a major player in the Internet. [...] (Quantitatively, Akamai serves 10-30% of all internet traffic, and has a market cap ≈ $19B.)
This makes the rejection notice so funny.
> In the first lesson, they discuss consistent hashing, and they seem to have achieved their goals.
I was really excited when I read your comment here before clicking the link, but having had a look at the rest of the curriculum, I'm slightly underwhelmed.
- Generalization ... Empirical risk minimization.
- lossy compression
- Similarity Search. (Dis)similarity metrics: Jaccard, Euclidean, Lp....
- Regularization. The polynomial embedding and random projection, L2 regularization, and L1 regularization as a computationally tractable surrogate for L0 regularization.
- Understanding Principal Component Analysis (PCA). ... The simple geometry of "diagonals in disguise." The power iteration algorithm.
- Low-rank matrix approximations. The singular value decomposition (SVD), applications to matrix compression, de-noising, and matrix completion (i.e. recovering missing entries).
- Graphs as matrices and the Laplacian of a graph. Interpretations of the largest and smallest eigenvectors/eigenvalues of the Laplacian. Spectral embeddings. Interpretations of the second eigenvalue
- Markov Chains, stationary distributions. Markov Chain Monte Carlo (MCMC)
- Fourier methods
- Compressive sensing
- Linear and convex programming. Matrix completion
- Differential privacy
I was thinking that the vast majority of those topics should be pretty much standard knowledge for a mathematically trained computer scientist (not being an expert in each of them, but knowing the basics of what they do, how they work and where they're applied). What level is this course at?
Google exists in no small part because just over 20 years ago people who could also code and raise money connected just a few of the dots on the deep themes connecting those topics: https://www.rose-hulman.edu/~bryan/googleFinalVersionFixed.p...
Just over a decade ago Netflix paid out a million bucks (that was real money then) for a modest improvement over their existing recommender based on an SVD-like gradient descent for a low-rank approximate factorization: https://en.m.wikipedia.org/wiki/Netflix_Prize. Many of the competing teams had exemplary academic and industrial pedigree.
Many (if not most) ML practitioners would profit from thinking more about the information-theoretic links between lossy compression, regularization via norm, and channel capacity to this day.
If I correctly gather that this is a syllabus for elite undergraduates, they’ll be grading on a curve.
> Many (if not most) ML practitioners would profit from thinking more about the information-theoretic links between lossy compression, regularization via norm, and channel capacity to this day.
yes. don't forget compressed sensing there too
Well yes, this is literally that mathematical training.
Most taking this course are advanced 2nd year or 3rd or 4th year students who have taken the introduction to algorithms course. Most/many CS majors never take this class at all.
I’ve seen several Stanford courses (e.g CS229) so the low course number of 168 would seem to indicate that it’s taken within the first couple years of college.
at the veryleast this would belong to a second or third class of algorithms for ug( after the usual meat and potatoes: big,small o notation, searching and sorting, dp, greedy algorithms and so on) depending on the difficulty of the assignments this could be easily a graduate course
remember that no matter how difficult, obscure or new a technical field is you will have people here claiming they took a class about it as a freshman 10 years ago and they wrote some papers about it. sometimes it may be true, but most of the time it isnt
spoilers: this course is intended to mathematically train computer scientists.
I love this book. As opposed to the way that linear algebra is typically introduced, this book focuses on concrete applications (like text analysis, image/signal processing, finance, ML, etc.) and eschews more arcane concepts (like eigen). To me, building practical intuition is the best way to learn* the subject.
A more advanced but still accessible manuscript by Boyd et al: Generalized Low Rank Models (establishes connections between PCA/SVD and many other matrix factorization methods, and shows you how to roll your own): https://web.stanford.edu/~boyd/papers/pdf/glrm.pdf
> Factor analysis, principal component analysis, mixtures of gaussian clusters, vector quantization, Kalman filter models, and hidden Markov models can all be unified as variations of unsupervised learning under a single basic generative model.
Interesting to me is that a lot of the material you could also find in a theoretical machine learning course or in an applied mathematics course. Before seeing the syllabus I was expecting more on streaming algorithms, randomized algoriths, etc. In my experience most Computer Science students get a bit freaked out when, e.g., concentration inequalities enter the scene.
"Nothing I learned in CS has an application to industry programming" is a regular complaint in discussion on education here and elsewhere. This is a good course to point to for people who have this very limited view on CS.
> Lecture 11 (Mon 5/2): Graphs as matrices and the Laplacian of a graph. Interpretations of the largest and smallest eigenvectors/eigenvalues of the Laplacian. Spectral embeddings, and an overview of applications (e.g. graph coloring, spectral clustering.)
What industry fields does this apply to? Machine Learning?
The web is a graph. Each node in the graph is a web page. Each edge is a connection a hyperlink between pages. You can represent a graph as a matrix.
If you random click on links you'll end up visiting some web pages (the more connected ones) more often than others. You can define a probability distribution over pages as "what is the probability I'll end up at this web page after an infinite number of clicks". This is the stationary distribution of a Markov chain.
The stationary distribution is the largest eigenvector of the matrix that represents the graph. This gives a way to compute the stationary distribution via well studied algorithms.
You can use this idea to
1) assign importance to pages based on the magnitude of the probability, to improve web search. You might call this algorithm PageRank.
2) found a company called Google that is currently worth USDtrillions.
1) use the raw count of inbound links, weighted by the count of inbound links of the linking pages, normalize by the total number of links on that page, and run it a few iterations to get a first approximation of the probability distribution. This is a pretty intuitive approach, would almost certainly have been good enough for Google, and avoids all the jargon, probability, and "well studied algorithms".
2) found a company called Google that is currently worth US$trillions.
I love algorithms as much as the next guy, but PageRank is not a fantastic example of success-because-I-knew-eigenvectors despite what their PR folks would have you believe. One can't deny, though, that Google's PR has definitely attracted them a lot of super smart engineers over the decades, especially in the early days!
I remember one time when I realized this: a TV show character suggested building an app that lets you take a picture of someone's shoes and then give you links where you could buy them. It sounded a) like a pretty good business idea and b) crazy hard to build (the time the show aired was before the Deep Learning proliferation iirc).
I do agree that algorithms are fun and the basic ones are probably useful in everyday work, but for anything complicated you'd rather use a proper library. It's also definitely good to have knowledge of their internal workings though.
I'm somewhat familiar with all of the topics (except privacy preservation), but I'm a bit surprised to see these all lumped together. They're all certainly useful, but they seem some what sparsely related.
Can someone tie together
- Probabilistic data structures & hashing
- PCA/SVD/Sampling/Compressed Sensing
- Privacy preservation
for me? They seem like they should be three independent courses.
For anyone interested in the PCA/SVD/Compressed Sensing - Steve Brunton[0] (prof at UW) has a youtube channel full of various lectures from vector calculus, pca, svd, dynamical systems, and more
Well clearly people haven't been taking courses as cool as this.
My experience is that if I'm comfortable with a topic, text is far more effective as a medium to absorb knowledge from. For learning programming languages, for example, I've found it much more effective to read books that to sit for lectures or online videos.
However, for topics like complex mathematics or algorithms, especially with dense terminology, text often appears like an impenetrable wall of text for me. Good video lectures help me see through the professor's thought process and divide the problem in smaller, more comprehensible parts.
In my opinion, the strongest advantage of video content is that they include an element of guided attention. A good video can forcefully mute the secondary details and highlight the essence of a concept or process.
I can see how you can spend hours on videos and not learn a lot though. After getting an insight from a video, the concepts need to be practiced through exercises, which is active as compared to passive watching, else the advantages are lost because the information can be easily forgotten.
Much like traditional lectures, in fact.
I had a doubt when I did realize I could not find one of the most important topics of computer science: proof of accuracy of floating point computations.
I see this more like an index of a library of various algorithms, and that, I think it's good.
Are there algorithm courses that take into account how hardware affects algorithms? For example with databases, you have implement theoretically inefficient algorithms which are faster in practice (mostly because they use sequential access).
That said, there are areas within algorithms that do look at optimizing for typical hardware. E.g. cache oblivious algorithms are designed to take advantage of caches as found in modern CPUs.
A lot of his work is in the journal "Experimental Algorithmics", so I guess there are a substantial number of people working in this way. I don't know this field very well, and I don't know if there are general principles that have been extracted from their work.
This course is also more about solving problems in the first place rather than implementation efficiency.
It presupposes the basics of CS (such as hashing) and mathematics (such as some linear algebra). The prerequisites are CS107 (Computer Organization & Systems) and CS161 (Design and Analysis of Algorithms), which have prerequisites in turn.
The lecturers write:
> We welcome all comers — there’s a zillion courses you could be taking, and we’ll be happy and flattered if you decide to take this one. That said, to prepare a coherent lecture, it’s helpful to have a target audience in mind. We view the canonical student in the class as a senior-year computer science major. As you can see in this lecture, we assume a certain degree of “computer science maturity,” taking for granted that you know and care about concepts like caching, hashing, balanced search trees, and so on. We also assume sufficient programming maturity to translate the high-level descriptions given in lecture to working implementations.
> Our ambition is for this to be the coolest computer science course you’ve ever taken. Seriously!
I view this type of courses as pointless. There's not enough time to cover any problems or pitfalls.
The course description is especially ironic as it claims rigor.
> This course will provide a rigorous and hands-on introduction to the central ideas and algorithms that constitute the core of the modern algorithms toolkit.
The result, of course, will be a bunch of undergrads with a very hazy recollection, and zero real knowledge.
Seriously?
Having been a TA for a course with similar pretentions. Students will be miserable because they aren't given the tools to deal with the homework, they will learn very little, and forget it all very quickly