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 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 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.
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 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.
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
| 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.
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
| <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, |
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 enum import Enum | |
| nodes = connectome | |
| class NeuronState(): | |
| S = 1 | |
| E = 2 | |
| R = 3 | |
| class TopologicalSimulator: |