Skip to content

Instantly share code, notes, and snippets.

@theScinder
theScinder / schmittRes.py
Created January 16, 2018 12:38
char-Res-Schmitt
# Reservoir computing character prediction text generator
# Perturb a dynamic reservoir with character inputs, predict next character with linear classifier
# ________
# | |
# V | random connections with some sparsity
#input--->o--->o--->o |
# | | | |
# V V V |
# o--->o--->o--
# | | |
from matplotlib import pyplot as plt
import matplotlib as mpl
import numpy as np
def roulette(maxBet,startBet,startCash,betMulti,goalCash,myIt):
# My buddy assures me this is a sure thing . . .
# maxBet - maximum allowed bet
# startCash- your principal
# betMulti - mulyiply your bet X this amount if unsuccessful
# goalCash - how much you want to leave the table with
@theScinder
theScinder / trainNNXOR.py
Created March 2, 2017 09:01
Teaching a Machine to XOR (visualize learning process)
# Training a neural XOR circuit
# In Marvin Minsky Seymour Papert's in/famous critique of perceptrons () published in 1969, they argued that neural networks
# had extremely limited utility, proving that the perceptrons of the time could not even learn
# the exclusive OR function. This played some role
# Now we can easily teach a neural network an XOR function by incorporating more layers.
# Truth table:
# Input | Output
# 00 | 0
# 01 | 1
# 10 | 1
@theScinder
theScinder / draw_neural_net.py
Last active January 22, 2018 17:04 — forked from craffel/draw_neural_net.py
Draw a neural network diagram with matplotlib!
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes,Theta0,Theta1):
'''
Public Gist from craffel
https://gist.github.com/craffel/2d727968c3aaebd10359
Draw a neural network cartoon using matplotilb.
I (theScinder) modified the function to accept neural network weights and adjust connection line widths accordingly, in order to create an animation of NN learning