This file contains hidden or 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
# Back-Propagation Neural Networks | |
# | |
# Written in Python. See http://www.python.org/ | |
# Placed in the public domain. | |
# Neil Schemenauer <[email protected]> | |
# | |
# Changes: | |
# 2009-01-30 Fix dsigmoid() to use correct derivative rather than an | |
# approximation. Suggested by Andrew Lionel Blais. | |
This file contains hidden or 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
#!/bin/sh | |
echo "" | |
echo "Reuben, Reuben, I've been thinkin," | |
echo "what a fine world it would be," | |
echo "if all the $1 were just transported" | |
echo "all across the northern sea." | |
echo "" |
This file contains hidden or 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 | |
#http://cheezburger.com/4925161216 | |
parts = { | |
'a': 'Hip', 'b': 'Dip', 'c': 'Squoo', 'd': 'Bada', 'e': 'Meep', | |
'f': 'Bloo', 'g': 'Caw', 'h': 'Squee', 'i': 'Woobly', 'j': 'Badum', | |
'k': 'Loo', 'l': 'Derp', 'm': 'Nerp', 'n': 'Spee', 'o': 'Papa', | |
'p': 'Moom', 'q': 'Dub', 'r': 'Pa', 's': 'Naw', 't': 'Ka', | |
'u': 'Mim', 'v': 'Zap', 'w': 'Nup', 'x': 'Na', 'y': 'Yee', | |
'z': 'Zoop', ' ': ' ' | |
} |
This file contains hidden or 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 csv | |
import matplotlib.pyplot as plt | |
def import_text(filename, separator): | |
for line in csv.reader(open(filename), delimiter=separator, skipinitialspace=True): | |
if line: | |
yield line | |
results = [] | |
t = [] | |
x = [] |
This file contains hidden or 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
N = 10; | |
k = 1; | |
P0 = [zeros([N, 1]) ; 1]; | |
A = irreversible(N); | |
f = @(t,P)mastereqn(P,A); | |
[tvec,P]=ode45(f, [0,25], P0); | |
tvecsize = size(tvec); | |
num_timesteps = tvecsize(1); | |
% % Uncomment to check probability sums: |
This file contains hidden or 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
function [nlist, tlist] = birthdeath(l,K,numsteps) | |
nlist =[0]; % list of numbers of transcripts at corresponding place in t | |
tlist =[0]; % list of times. drawn from bernoulli distribution. | |
evlist=[0]; % list of events. degradation is -1, transcription is 1,neither is 0. | |
t = 0; | |
n = 0; | |
ev = 1; | |
for j=[1:numsteps] | |
t = t - log(1-rand(1))/(K*n+l); | |
tlist = [tlist t]; |
This file contains hidden or 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
def n232nondiscriminant(a,b): | |
return(b-a**2-1) | |
def n232discriminant(a,b): | |
return((a**2-b+1)**2 - 4*a**2) | |
if __name__ == "__main__": | |
stable_real_a = [] | |
stable_real_b = [] | |
unstable_real_a = [] |
This file contains hidden or 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/env python | |
#with open('/home/tsbertalan/bin/wordlists/nounsb.txt') as f: | |
with open('/home/tsbertalan/bin/wordlists/nouns/91K nouns.txt') as f: | |
nouns = f.read().splitlines() | |
#with open('/home/tsbertalan/bin/wordlists/adjectivesb.txt') as f: | |
with open('/home/tsbertalan/bin/wordlists/adjectives/28K adjectives.txt') as f: | |
adjs = f.read().splitlines() | |
nouns = list(set(nouns)) | |
adjs = list(set(adjs)) | |
from random import choice |
This file contains hidden or 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 math import exp, cos, sin | |
def print_answers(fs, fnames, W, tx=4.0): | |
for (name, f) in zip(fnames, fs): | |
print name+'(', tx, '):', f(tx) | |
print " W(", tx, "):", W(tx) | |
def n32b(): | |
f1 = lambda t: exp(float(t)) * (3.0 / 4.0 - t / 2) - exp(-1.0 * t) / 4 | |
f1p = lambda t: exp(float(t))*(1./4-t/2)+exp(-t)/4 |
This file contains hidden or 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
# Really, when tuning, you have a reference note a fifth above or below the | |
# target note. But, just to show a beat-frequency effect, having the reference | |
# and target notes be about the same frequency is fine. | |
import numpy as np | |
import matplotlib.pylab as plt | |
length = 444 # make this larger if the waves shown are not very wave-like | |
resolution = 10000.0 | |
xl = list(np.arange(1, length, length / resolution)) | |
w1 = 1.0 |
OlderNewer