Skip to content

Instantly share code, notes, and snippets.

View robertmaxwilliams's full-sized avatar
💭
student

Robert robertmaxwilliams

💭
student
View GitHub Profile
import random
import subprocess
import shlex
cows = ['apt', 'beavis.zen', 'bong', 'bud-frogs', 'bunny', 'calvin', 'cheese', 'cock', 'cower',
'daemon', 'default', 'dragon', 'dragon-and-cow', 'duck', 'elephant', 'elephant-in-snake',
'eyes', 'flaming-sheep', 'ghostbusters', 'gnu', 'head-in', 'hellokitty', 'kiss', 'kitty',
'koala', 'kosh', 'luke-koala', 'mech-and-cow', 'meow', 'milk', 'moofasa', 'moose',
'mutilated', 'pony', 'pony-smaller', 'ren', 'sheep', 'skeleton', 'snowman',
'sodomized-sheep', 'stegosaurus', 'stimpy', 'suse', 'three-eyes', 'turkey', 'turtle', 'tux',
from itertools import combinations
from copy import copy
import pdb
def grabpoints(size, mod, pointnums):
""" returns nums under size
that are divisible by mod,
duplicated on pointnums
"""
box = {n for n in range(size) if n%mod == 0}
@robertmaxwilliams
robertmaxwilliams / discretize_gassian.py
Last active February 28, 2018 00:36
converts numbers into other numbers, good luck me in the future.
# copy filter from here and paste into stdin
# http://dev.theomader.com/gaussian-kernel-calculator/
input_string = input("paste in filter, it won't have spaces but that's okay: ")
float_filter = [float('0.'+x) for x in input_string.split('0.')][1:]
smallest = min(float_filter)
discrete_filter = [round(x/smallest) for x in float_filter]
print(discrete_filter)
@robertmaxwilliams
robertmaxwilliams / 1d-convolution.c
Last active February 22, 2018 04:19
1d convolution in c for lidar data smoothing
#include <stdio.h>
/* Useful vidoes:
1d kernel for data processing:
https://www.youtube.com/watch?v=D0F-NPerCIE
numberphile on image bluring (same thing in 2d):
https://www.youtube.com/watch?v=C_zFhWdM4ic
excellent explanations in there. It introduced me to the concept.
*/
#! /usr/bin/python
# -*- coding: utf8 -*-
""" GAN-CLS """
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
from tensorlayer.prepro import *
from tensorlayer.cost import *
import numpy as np