Tag: programming

Competitive Programming with AlphaCode

I'm excited to share more on our latest project, AlphaCode - a system to write programs, able to reach roughly median human performance in coding competitions. And that's median competitive programmer performance, not median programmer or median human! In addition to our paper and [cached]official blog post, you can also find my personal take below.

Problem Setup

Coding competitions are difficult even for experienced programmers. Before writing the first character of a program, the first step is to understand the natural language problem description: often spanning several paragraphs in length, problem descriptions do not directly describe the required algorithm, but …


Values, Pointers and References in C++

If you've primarily used high level languages like Python, you may not be used to explicitly thinking about the ownership or representation of your values in memory.1 In system languages like C++ or Rust, we have direct control over these aspects, and are able to use the type system to explicitly represent when a function takes ownership of a value, vs when it only takes a (temporary) reference.2

First, different types of ownership, in order of preference:

  • T t. A normal owned value of type T, uniqlue owned. If declared as a variable it is stored on the …

Complexity Budget

No matter how smart, there's a limit to how much you can keep in mind at once before you start forgetting something. In the context of software engineering, a common term for this is complexity budget: the maximum complexity of a system you can understand at once.

Just as fitting an entire task into the cache of your CPU is orders of magnitude faster than paging in from RAM (or worse, disk!), fitting the entire problem you are working on into your brain can make you many times more productive.

Every line of code you write, every feature you add …


MuZero talk - ICAPS 2020

I gave a detailed talk about MuZero at ICAPS 2020, at the workshop "Bridging the Gap Between AI Planning and Reinforcement Learning".

In addition to giving an overview of the algorithm in general, I also went into more detail about reanalyse - the technique that allows MuZero to use the model based search to repeatedly learn more from the same episode data.

I hope you find the talk useful! I've also uploaded my slides for easy reference.


Static & Dynamic Typing

I've written and been paid to write code in a wide variety of languages - functional and imperative, statically and dynamically typed, verbose and concise. Over time, I came to appreciate the benefits of certain language features.

The one I want to talk about today is static typing. My programs in statically typed languages seem to be systematically more likely to work correctly on the first try, more robust against bugs introduced by refactoring or adding new features, and easier to reason about. In fact, the benefits are so large that I now use pytype even for Python scripts with just …


A simple way to run Rust WebAssembly in a browser

The [cached]Rust WebAssemply book has a detailed introduction to WebAssembly in Rust; unfortunately it's example setup is somewhat complicated and requires the use of npm just to run show a simple Hello World! message in the browser.

Luckily, there's a simpler way to get started if you don't care about npm modules.

First, follow the [cached]setup instructions to install the rust toolchain, wasm-pack and cargo-generate. You don't need npm.

Clone the example project template:

1
cargo generate --git https://github.com/rustwasm/wasm-pack-template

which will prompt you for a project name, in the following we'll assume you used …


Getting into Machine Learning - 2020

My previous Getting into Machine Learning post is one of my most popular; since then much has changed.

There's a new kid on the block: [cached]JAX. A thin, but powerful layer over Autograd and XLA, it makes it easy to concisely express algorithms with the same syntax as numpy while getting the full performance of TPUs and GPUs.

Especially in combination with higher level libraries such as [cached]Haiku, JAX makes it fun and easy to try new ideas. I've migrated all my own research to JAX and can only recommend it!

The resources I recommended in my previous …


MuZero - Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model

I'm excited to finally share some more details on what we've been working on since AlphaZero.

Recently, we made our latest paper - Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model, aka MuZero - available on arXiv:

Constructing agents with planning capabilities has long been one of the main challenges in the pursuit of artificial intelligence. Tree-based planning methods have enjoyed huge success in challenging domains, such as chess and Go, where a perfect simulator is available. However, in real-world problems the dynamics governing the environment are often complex and unknown. In this work we present the MuZero …


Debugging Android devices with adb on Ubuntu

Just some notes for myself next time.

Either download the [cached]Platform Tools package or directly install adb from the repository:

1
sudo apt install adb

If you are running Ubuntu, make sure that you are in the plugdev group (sudo usermod -aG plugdev $LOGNAME [cached]if not). You may have to create a udev rule to ensure the device is mounted under the right group.

To do so, create a file /etc/udev/rules.d/51-android.rules:

1
2
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0660",
GROUP="plugdev", SYMLINK+="android%n"

Where vendor and product id …


Lonely Planet on Kindle - The Cheap Way

Lonely Planet guidebooks are nice to get a quick overview of a place, or find some things worth seeing and doing around where you are traveling. However, lobbing around an extra half a kilo or more isn't great.

I'm already carrying my e-reader, so wouldn't it be great if I could just save the relevant sections there?

However, while they do sell an official Kindle edition, I prefer using the paperback versions when planning my trip. So instead of buying it twice, I simple scanned the relevant pages at the office, then cropped them into a single paged pdf with …

© Julian Schrittwieser. Built using Pelican. Theme by Giulio Fidente on github. .