View features.go
package main
import (
"encoding/csv"
"flag"
"fmt"
"math/rand"
"os"
"strings"
"time"
View data.go
package main
import (
"fmt"
"math"
"math/rand"
"time"
)
func main() {
View linear_bayes.go
// Use Bayes' rule to compute a probability distribution
// over linear models, then use the linear models on a
// simple classification problem.
package main
import (
"image"
"image/color"
"image/png"
View gen.sh
#!/bin/bash
binarize() {
xxd -b | sed -e 's/ .*//g' | sed -e 's/.*://g' | tr $'\n' ' ' |
sed -e 's/\(.\)/ \1/g'
}
while true
do
path=$(mktemp -t hashgen)
View idioms.go
// Produces hilarious quasi-idioms, like:
//
// add insult to the drawing board
// every cloud has a dead horse
// an arm and a blue moon
// an arm and a dead horse
// take with a grain of one's pants
// get bent out of both worlds
// have eyes in the room
// it takes two to the choir
View cifar_svm.go
package main
// Multi-class linear SVM gets up to 38% validation
// accuracy on CIFAR-10.
import (
"flag"
"image"
"image/color"
"image/png"
View main.go
// Quickly hand-verify inputs to my ResNet
package main
import (
"image"
"image/color"
"image/png"
"math/rand"
"os"
View soylent.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View cartpole.go
// Use model-based reinforcement learning to solve
// CartPole in as few episodes as possible.
package main
import (
"log"
"math"
"math/rand"
"time"
View cartpole.py
import gym
import numpy as np
import random
# Use policy gradients to train a linear model.
# Achieves a good success rate after 500 trials.
def softmax(vec):
divisor = np.sum(np.sum(np.exp(vec)))
return np.exp(vec) / divisor