Skip to content

Instantly share code, notes, and snippets.

View theideasmith's full-sized avatar

Akiva Lipshitz theideasmith

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import matplotlib.pyplot as plt
import numpy as np
def gen_vectors(f,x,y):
assert len(x) == len(y)
d = len(x), len(y)
t = len(x)
res = []
xs = []
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theideasmith
theideasmith / Statskit.py
Last active February 1, 2017 14:59
A Not For Production Implementation of Statistical Functions. I'm taking stats this semester.
from numpy import *
import matplotlib.pyplot as plt
import numpy as np
class DiscreteRandomVariable:
def __init__(self,X, P, bins):
self.X = X
self.P = P
self.H = P*X.shape[0]
self.bins = bins
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class AbstractRegression:
def __init__(self, xs, ys, w,alpha, epsilon=0.02):
self.w = w
self.xs = xs
self.ys = ys
self.yhats = self.f(self.xs,self.w)
self.loss =
self.a = alpha
self.N = xs.shape[0]
self.e = epsilon
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<ipython-input-20-db8ed034fc79> in <module>()
----> 1 model.fit(X,y)
<home>/.conda/envs/flytrackerML/lib/python2.7/site-packages/keras/models.pyc in fit(self, x, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, **kwargs)
406 shuffle=shuffle,
407 class_weight=class_weight,
--> 408 sample_weight=sample_weight)
409
410 def evaluate(self, x, y, batch_size=32, verbose=1,
from enum import Enum
nodes = connectome
class NeuronState():
S = 1
E = 2
R = 3
class TopologicalSimulator: