Skip to content

Instantly share code, notes, and snippets.

Alex Nichol unixpickle

Block or report user

Report or block unixpickle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@unixpickle
unixpickle / data.py
Created Nov 18, 2019
3D model generator model
View data.py
"""
Reading data produced by an external program.
"""
import math
import random
import numpy as np
import torch
@unixpickle
unixpickle / README.md
Created Nov 14, 2019
Hacking Lily's Garden
View README.md

Overview

In this document, I will describe how I managed to get unlimited stars and coins in the Android game "Lily's Garden". In short, here are the steps:

  • Use the adb backup feature to extract all of the game's data
  • Extract the Android backup into a tar file
  • Modify the file which stores the number of coins and stars
  • Re-sign the coins/stars field using a reverse-engineered HMAC key
  • Convert the tar file back to an Android backup
@unixpickle
unixpickle / load_collider.go
Created Nov 2, 2019
3D model generator data source
View load_collider.go
package main
import (
"compress/gzip"
"fmt"
"math"
"os"
"github.com/unixpickle/model3d"
)
View maml.py
import math
import torch
import torch.nn.functional as F
def maml_grad(model, inputs, outputs, lr, batch=1, checkpoint=False):
"""
Update the model gradient using MAML.
"""
@unixpickle
unixpickle / maml.py
Created Oct 12, 2019
MAML in PyTorch
View maml.py
import torch
import torch.nn.functional as F
def maml_grad(model, inputs, outputs, lr, batch=1):
"""
Update a model's gradient using MAML.
The gradient will point in the direction that
improves the total loss across all inner-loop
View word_stats.py
letters = 'abcdefghijklmnopqrstuvwxyz'
with open('/usr/share/dict/words', 'rt') as in_file:
words = [x.strip() for x in in_file.readlines()]
counts = {}
starts = {}
total = 0
for letter in letters:
counts[letter] = len([x for x in words if x.endswith(letter)])
@unixpickle
unixpickle / config.md
Last active Oct 13, 2019
Configuring Linux Machine
View config.md

This is a set of things I suggest you do on a new Ubuntu machine to make it nice and (almost) Mac-like.

Install some packages

sudo apt install -y xclip
sudo apt install -y caffeine
sudo apt install -y gnome-tweaks
@unixpickle
unixpickle / poly_points.py
Last active Feb 6, 2019
Find vertices of a dodecahedron
View poly_points.py
"""
Generate points for a dodecahedron by solving an
optimization problem.
Gradient descent doesn't always converge to the global
minimum, so I run it repeatedly and keep printing the
solutions it comes up with if they're better than the
previous solution.
"""
@unixpickle
unixpickle / normact.py
Created Feb 4, 2019
Normalization as an activation function
View normact.py
"""
Get 99% accuracy on MNIST with a norm-activated network.
Test set: Average loss: 0.0395, Accuracy: 9880/10000 (99%)
Based on: https://github.com/pytorch/examples/blob/master/mnist/main.py
"""
import argparse
import torch
View puzzle.go
// Solve this logic puzzle:
// https://xmonader.github.io/prolog/2018/12/21/solving-murder-prolog.html
package main
import (
"fmt"
"github.com/unixpickle/approb"
)
You can’t perform that action at this time.