I seem to have picked up several new subscribers since the last edition of my newsletter, so welcome, and thank you for taking the time to read through a transcription of the random thoughts that pop into my head throughout the week!
My team is currently two weeks into working from home due to COVID-19. It was rough at first, but I think I’m starting to adapt. Plugging my work laptop into the monitor I have at home makes my setup almost identical to the one at my desk at work. Of course, this is largely enabled by Google’s wealth of internal developer tooling, but I digress.
I’ve of course been doing my part in practicing social distancing (luckily staying at home without being bored out of my mind is a skill that I’ve honed over several years). On the odd occasion that I have gone out, though, the streets have been eerily empty. I only saw a few people walking around Downtown Seattle on a Saturday morning, and a brunch spot that typically requires reservations several days in advance had empty tables at noon.
On the one hand, it’s reassuring that people in Washington are taking this seriously. It did make my reflect harder on how much of an impact this is going to have on society, though. These precautionary measures are going to continue for a month more at minimum, if not several, which is unprecedented. Local businesses are going to be hit hard. After we’ve weathered the storm, it will be interesting to see how attitudes towards things like remote work and public health will have shifted.
Writing up my blog post on zeal.gg’s architecture and reading people’s praise gave me a small spark of motivation to do some more work related to the site.
I realized my blog post didn’t go into much depth about how I went about setting up the Heroku deployment, and it felt like too much to append to the original post. In addition, many people I showed the site to were also curious about my deployment process (arguably the most confusing and least documented step of shipping a web app).
I spent a few hours lifting the core of zeal.gg’s codebase into a new repository and released Dagger, my approach to deploying a Flask + React app on Heroku. The project is named as such because in League, a Zeal is built by combining two different items: a Dagger and a Cloak of Agility.
It took me a lot of iterating to arrive on this template, but it seems to do the trick. It relies on using a buildpack that allows multiple buildpacks to be specified on a per-directory basis. The build process then packages the React app into static files, then configures nginx to route API requests to the Flask backend and treat anything else as a frontend request.
This all may seem overcomplicated (and perhaps it is; pull requests welcome!), but I wanted an approach that made local development and the actual deployed site feel identical. This is non-trivial. Locally, Flask and Node spin up their own development servers on two different ports, and requests need to be proxied from the frontend to the backend API. When actually deployed, the server (obviously) only accepts requests on a single port, which is why I manually set up nginx.
I don’t know when I’ll personally be able to make use of this template, but I thought I would at least put it out there so that other people could learn from my deployment struggles.
A couple weeks ago, DeepMind released AlphaGo – The Movie on YouTube. I watched it at the Vancouver Film Festival back in 2017 when it premiered, but since it was back on YouTube, I decided to rewatch it. (Spoilers ahead, I guess?)
To anyone who likes documentaries, I highly recommend it; I found it entertaining even during my second viewing. It’s directed in a manner that both makes you want to side with Lee Sedol in the fight against the machine, but also causing you to appreciate the gravity of what the DeepMind team had achieved with AlphaGo.
One of the most important moments in the five-game series was AlphaGo’s move 37 in game 2, which is covered quite in-depth in this Wired article if anyone is interested in further reading. In the documentary, Lee comments on this move after the match:
I thought AlphaGo was based on probability calculation and that it was merely a machine. But when I saw [move 37], I changed my mind. Surely AlphaGo is creative. This move was really creative and beautiful.
Creativity is universally treasured across cultures. We don’t just appreciate beautiful works of art, music, and literature, but also admire their creators. The act of imagining up something novel is what creativity is all about, and in our anthropocentric world-view, we tend to associate it with humanity itself.
This move brings up the debate of whether AIs (which are just computer programs) could be considered creative. StyleGAN and similar models can be used to create very realistic images of people using no apparent source material, but is this considered creative? Was AlphaGo’s move creative, when what occurred was just an algorithm evaluating billions of game tree branches and stochastically choosing the one with the highest reward? I’m still not sure which way I lean.
Another interesting thing that came up in Game 2 was AlphaGo’s subversion of human players’ tendency to use score as a proxy for chance of winning. The AI appeared to make strange so-called “slack moves” in the end game. These moves seemed like mistakes and giving Lee a way to claw back the win, but it soon became clear that AlphaGo was ahead by a couple of points despite these supposed flubs.
In hindsight, it is clear to everyone who understands basic game theory that these moves were probably chosen to maximize AlphaGo’s probability of winning the overall game. You gain nothing of substance from winning by 10 points compared to winning by 1, so for an oracle with perfect knowledge of the end game, there is no reason to go for the former if the latter outcome has the higher probability.
While obvious in theory, for games as complex as Go, it just isn’t feasible for a human player to evaluate to all of these positions and come to quantifiable win percentages, so the strategy tends to just be to optimize for winning by as large a margin as possible, and hope that your lead doesn’t completely dwindle before the end of the game. I’d be very interested in seeing if practicing against AIs would lead to a adaptation in behaviour with respect to securing the win.
I’ve tried on more than a couple of occasions to pick up chess and Go to no avail. Perhaps being trapped indoors for the rest of March and likely well into April will give me another excuse to try once more.
Until next week — don’t panic, and wash your hands!