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
-2.844059489096403048e+00 -3.390078096791193651e+00 | |
-2.246556725692058443e+00 -4.134951453470232963e+00 | |
-2.882040217945443406e+00 -2.989992710367860074e+00 | |
-3.557989559969744420e+00 -4.874133498203447878e+00 | |
-4.276468588458921083e+00 -4.949100415222556393e+00 | |
-4.063084646541525125e+00 -4.965449471424126848e+00 | |
-4.149768316170935556e+00 -4.304566658733071982e+00 | |
-3.397283783389075218e+00 -2.450041447189784449e+00 | |
-6.116576211048087686e+00 -4.566201068837830945e+00 | |
-4.549464218962874895e+00 -4.120424270357679220e+00 |
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 itertools import chain | |
class JsonFlatten: | |
"""Flattens nested dictionaries into a flat key/value mapping. | |
This encoding is designed to be used with DictVectorizer | |
See also | |
-------- | |
:class:`sklearn.feature_extraction.DictVectorizer` to pass for |
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 numpy as np | |
from pymc import Model, Gamma, Normal, Dirichlet | |
from pymc import Categorical | |
from pymc import sample, Metropolis | |
k = 3 | |
ndata = 500 | |
v = np.random.randint(0, k, ndata) | |
data = ((v == 0)*(50 + np.random.randn(ndata)) |
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 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 keras.models import Sequential | |
from keras.layers.core import Dense, Dropout, Activation | |
from keras.optimizers import SGD | |
import numpy as np | |
X = np.array([[0,0],[0,1],[1,0],[1,1]]) | |
y = np.array([[0],[1],[1],[0]]) | |
model = Sequential() | |
model.add(Dense(8, input_dim=2)) |
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 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
# Update to 4.9 kernel do not delete the old kernel as it will be your failsafe if something happens to this one | |
# Install KabyLake graphics patches | |
cd /tmp; | |
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/kbldmcver101.tar.bz2; | |
tar xjvf kbldmcver101.tar.bz2; cd kbl_dmc_ver1_01/; sudo ./install.sh | |
cd /tmp; | |
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/kblgucver914.tar.gz; | |
tar xvzf kblgucver914.tar.gz; cd firmware/kbl/guc/kbl_guc_ver/; sudo ./install.sh |
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 BayesianModel(object): | |
samples = 2000 | |
def __init__(self, cache_model=True): | |
self.cached_model = None | |
self.cached_start = None | |
self.cached_sampler = None | |
self.shared_vars = {} | |
def cache_model(self, **inputs): | |
self.shared_vars = self._create_shared_vars(**inputs) |
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 numpy as np | |
from keras.models import Sequential | |
from keras.layers.core import Activation | |
from keras.layers.wrappers import TimeDistributed | |
from keras.preprocessing.sequence import pad_sequences | |
from keras.layers import Embedding, LSTM, Dense | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import confusion_matrix, accuracy_score, precision_recall_fscore_support | |
raw = open('wikigold.conll.txt', 'r').readlines() |
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
{-# LANGUAGE FlexibleInstances #-} | |
-- | An implementation of Section 3, Local Type Argument Synthesis, from the | |
-- paper /Local Type Inference/ by Pierce and Turner. | |
module Infer where | |
import Control.Monad (foldM, join, zipWithM) | |
import Data.Function (on) | |
import Data.List (foldl', groupBy, intercalate, intersect, nub) |
OlderNewer