Skip to content

Instantly share code, notes, and snippets.

View aaronsnoswell's full-sized avatar

Aaron Snoswell aaronsnoswell

  • Australia
View GitHub Profile
@aaronsnoswell
aaronsnoswell / dacadc.py
Created June 2, 2018 03:25
Multidimensional discrete <-> continuous conversions
# -*- coding: utf-8 -*-
"""Multidimensional discrete <-> continuous conversions
Copyright 2018 Aaron Snoswell
"""
import math
import collections
import numpy as np
@aaronsnoswell
aaronsnoswell / bokeh_test.py
Created October 6, 2018 03:27
A hello world example for the Bokeh plotting library
from bokeh.plotting import figure, output_file, show
import numpy as np
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# Output to static HTML file
output_file("lines.html")
@aaronsnoswell
aaronsnoswell / pytorch_mnist.py
Created October 6, 2018 05:02
A hello world example for PyTorch implementing a ConvNet for MNIST
"""A basic PyTorch ConvNet implementation on the MNIST dataset
From http://adventuresinmachinelearning.com/convolutional-neural-networks-tutorial-in-pytorch/
"""
import os
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
import torchvision.datasets
@aaronsnoswell
aaronsnoswell / process_large_csv.py
Created October 14, 2018 23:24
Incrementally process a CSV file that is too large to fit in memory
import csv
import itertools
import multiprocessing.pool
def process_large_csv(
filename,
per_row,
worker_pool,
@aaronsnoswell
aaronsnoswell / common-syllables.txt
Created February 5, 2022 12:59
The 322 most common syllables (ordered most common to least) in the 5000 most common English words
ing
er
a
ly
ed
i
es
re
tion
in