from sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor, AdaBoostRegressor, ExtraTreesClassifier, RandomForestClassifier, AdaBoostClassifier
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.kernel_ridge import KernelRidge
from sklearn.linear_model import LinearRegression, Lasso, LogisticRegression
from sklearn.neural_network import MLPRegressor, MLPClassifier
from sklearn.svm import SVC, SVR
from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cowsay 'hello world' | cowsay -n | cowsay -n | cowsay -n | cowsay -n | |
__________________________________________ | |
/ ______________________________________ \ | |
| / __________________________________ \ | | |
| | / ______________________________ \ | | | |
| | | / _____________ \ | | | | |
| | | | < hello world > | | | | | |
| | | | ------------- | | | | | |
| | | | \ ^__^ | | | | | |
| | | | \ (oo)\_______ | | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import os.path as p | |
import random | |
import sys | |
# TODO: DO TO | |
PACKAGE_NAME = "mastml" #TODO | |
#pure_print = print | |
#def make_myprint(leader): | |
# def myprint(*args): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun inverse-collatz (n) | |
"returns a list with one or two values that collatz to n" | |
(cons (* 2 n) | |
(let ((other-result (/ (- n 1) 3))) | |
(if (integerp other-result) | |
(list other-result) | |
nil)))) | |
;; use lambda closure to access lexically scoped variable "starting-list" |
OlderNewer