Skip to content

Instantly share code, notes, and snippets.

View Mononofu's full-sized avatar

Julian Schrittwieser Mononofu

View GitHub Profile
@Mononofu
Mononofu / muzero.py
Last active January 3, 2024 18:43
MuZero pseudocode
# Copyright 2022 DeepMind Technologies Limited.
# Licensed under the Apache License, Version 2.0 and CC BY 4.0.
# You may not use this file except in compliance with these licenses.
# Copies of the licenses can be found at https://www.apache.org/licenses/LICENSE-2.0
# and https://creativecommons.org/licenses/by/4.0/legalcode.
"""Pseudocode description of the MuZero algorithm."""
# pylint: disable=unused-argument
# pylint: disable=missing-docstring
# pylint: disable=g-explicit-length-test
@Mononofu
Mononofu / stochastic_muzero.py
Last active December 14, 2023 12:58
Pseudocode for Stochastic MuZero
# Copyright 2022 DeepMind Technologies Limited.
# Licensed under the Apache License, Version 2.0 and CC BY 4.0.
# You may not use this file except in compliance with these licenses.
# Copies of the licenses can be found at https://www.apache.org/licenses/LICENSE-2.0
# and https://creativecommons.org/licenses/by/4.0/legalcode.
"""Pseudocode description of the Stochastic MuZero algorithm.
This pseudocode was adapted from the original MuZero pseudocode.
"""
@Mononofu
Mononofu / muzero_unplugged.py
Last active January 13, 2023 15:02
Pseudocode for MuZero Unplugged
# Copyright 2022 DeepMind Technologies Limited.
# Licensed under the Apache License, Version 2.0 and CC BY 4.0.
# You may not use this file except in compliance with these licenses.
# Copies of the licenses can be found at https://www.apache.org/licenses/LICENSE-2.0
# and https://creativecommons.org/licenses/by/4.0/legalcode.
"""Pseudocode description of the MuZero Unplugged algorithm."""
# pylint: disable=unused-argument
# pylint: disable=missing-docstring
# pylint: disable=g-explicit-length-test
@Mononofu
Mononofu / mandelbrot.jl
Last active July 22, 2022 21:20
Rendering a mandelbrot zoom sequence with Julia
using ColorSchemes
using Dates
using Images
using Printf
colors = RGB{Float32}.(colorschemes[:inferno].colors)
n_colors = length(colors)
black = RGB{Float32}(0, 0, 0)
function interpolate_color(n)
@Mononofu
Mononofu / mandelbrot.jl
Created October 10, 2020 21:39
Rendering a mandelbrot zoom sequence with Julia
using ColorSchemes
using Dates
using Images
using Printf
using SIMD
const palette = RGB{Float32}.(colorschemes[:inferno].colors)
const n_colors = length(palette)
const black = RGB{Float32}(0, 0, 0)
@Mononofu
Mononofu / moonlander.py
Last active August 21, 2021 13:41
Converts Moonlander unicode entry macros from MacOS format (as generated by Oryx) to the corresponding Linux key-combinations.
#!/usr/bin/python3
import argparse
import os
import re
import subprocess
import zipfile
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
@Mononofu
Mononofu / health_checked.sh
Last active May 11, 2021 18:26
Helper script for https://healthchecks.io/ monitoring
#!/bin/bash
# Usage: health_checked.sh $UUID your command --with=args
UUID="$1"
PING_URL="https://hc-ping.com/${UUID}"
curl -fsS -m 10 --retry 5 -o /dev/null "${PING_URL}/start"
OUTPUT=$("${@:2}" 2>&1)
STATUS="$?"
@Mononofu
Mononofu / unscramble.scala
Created June 3, 2012 22:05
Text unscrambler
object Scramble extends App {
val words = io.Source.fromFile("/usr/share/dict/words").getLines()
val uniques = words.filter(! _.contains("'")).toList
// group words by what you get when you sort their individual characters
val scrambled_lookup = uniques.map(w => w.toList.sorted.mkString).zip(uniques).groupBy(_._1).map {
case (scrambled, ws) => (scrambled, ws.map(_._2))
}
// words whose sorted versions collide
val non_uniques = scrambled_lookup.toList.map(_._2).sortWith(_.length > _.length).filter(_.length > 1)
@Mononofu
Mononofu / share.css
Created March 15, 2012 18:59
socialshareprivacy inline, without jQuery
.social_share_privacy_area {
clear: both;
margin: 20px 0 !important;
list-style-type: none;
padding: 0 !important;
width: auto;
height: 25px;
display: block;
}
.social_share_privacy_area li {
@Mononofu
Mononofu / keybase.md
Created April 17, 2017 19:15
keybase.md

Keybase proof

I hereby claim:

  • I am mononofu on github.
  • I am mononofu (https://keybase.io/mononofu) on keybase.
  • I have a public key ASC1qnxTcR3i04BarLJtpNvwW72CsF5E15THvTFAWmTalQo

To claim this, I am signing this object: