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 cv2 | |
import math | |
import numpy as np | |
import matplotlib.pyplot as plot | |
import matplotlib.cm as cm | |
import sys | |
import pylab | |
from matplotlib.widgets import Slider | |
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 multiprocessing | |
class Dog(): | |
def __init__(self, name = "joe"): | |
self.name = name | |
def bark(self): | |
print("woof") | |
mg = multiprocessing.Manager() | |
dt = dict() |
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 urllib, urlparse | |
import re | |
from bs4 import BeautifulSoup | |
# Because I want pretty dict initialization | |
class Vividict(dict): | |
def __missing__(self, key): | |
value = self[key] = type(self)() | |
return value |
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 nengo | |
import nengo.spa as spa | |
D = 32 | |
model = spa.SPA() | |
with model: | |
model.vision = spa.Buffer(D) | |
model.speech = spa.Buffer(D) | |
model.memory = spa.Memory(D) |
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 nengo | |
from nengo import spa | |
D = 32 | |
vo = spa.Vocabulary(D) | |
vo.parse("A + B + C") | |
vo2 = spa.Vocabulary(D/2) | |
vo2.parse("D + E + F") | |
model = spa.SPA(vocabs=[vo, vo2]) |
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 nengo | |
from nengo import spa | |
D = 32 | |
vo = spa.Vocabulary(D) | |
vo.parse("A + B + C") | |
vo2 = spa.Vocabulary(D/2) | |
vo2.parse("D + E + F") | |
model = spa.SPA() |
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 nengo | |
from nengo import spa | |
import numpy | |
from collections import OrderedDict | |
print(numpy.version.version) | |
D = 64 | |
vocab = spa.Vocabulary(D, unitary=["ONE"]) |
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 scipy.signal import lti | |
def synthetic_neuron(drive): | |
""" | |
Simulates a mock neuron with a time step of 1ms. | |
Arguments: | |
drive - input to the neuron (expect zero mean; SD=1) | |
Returns: | |
rho - response function (0=non-spike and 1=spike at each time step) | |
""" |
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 pandas as pd | |
import numpy as np | |
from collections import OrderedDict | |
import re | |
import ipdb | |
terms = OrderedDict([ | |
("loss", []), | |
("acc", []), |
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
class AltEcho(Network, Reservoir): | |
n_neurons = IntParam('n_neurons', default=None, low=1) | |
dimensions = IntParam('dimensions', default=None, low=1) | |
dt = NumberParam('dt', low=0, low_open=True) | |
recurrent_synapse = SynapseParam('recurrent_synapse') | |
gain = NumberParam('gain', low=0, low_open=True) | |
neuron_type = NeuronTypeParam('neuron_type') | |
def __init__(self, n_neurons, dimensions, recurrent_synapse=0.005, |
OlderNewer