Skip to content

Instantly share code, notes, and snippets.

Nick Lothian nlothian

Block or report user

Report or block nlothian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fasttext_plus_continous_keras.py
inp = Input(shape=(maxlen,), name="text_input") # featureized text comes in here
x = Embedding(embedding_matrix.shape[0], embed_size, weights=[embedding_matrix], trainable=True)(inp)
x = Dense(some_num_here, activation="relu")(x)
extra_data = Input(shape=(1,), name="extra_data") # your continous features comes in here
combined = concatenate([x, extra_data])
# maybe some ReLu + Dropout here
@nlothian
nlothian / fasttext_to_tensorboard.py
Created Nov 23, 2017
Convert a FastText model to a form suitable for viewing in Tensorboard
View fasttext_to_tensorboard.py
from tensorflow.contrib.tensorboard.plugins import projector
import tensorflow as tf
import numpy as np
import os
meta_file = "g2x_metadata.tsv"
output_path = "./projections"
# read embedding file into list and get the size
with open('./ft_model.vec', 'r') as embedding_file:
View M.2 256GB Samsung 950 EVO
sudo fio --filename=./testfile --direct=1 --sync=1 --rw=read --bs=4k --numjobs=8 --iodepth=32 --runtime=60 --time_based --group_reporting --size=1G --name=journal-test
journal-test: (groupid=0, jobs=8): err= 0: pid=3092: Thu Jun 2 22:48:23 2016
read : io=21433MB, bw=365792KB/s, iops=91447, runt= 60001msec
clat (usec): min=11, max=15999, avg=86.72, stdev=34.31
lat (usec): min=11, max=15999, avg=86.81, stdev=34.31
clat percentiles (usec):
| 1.00th=[ 60], 5.00th=[ 63], 10.00th=[ 66], 20.00th=[ 75],
| 30.00th=[ 78], 40.00th=[ 80], 50.00th=[ 82], 60.00th=[ 90],
View imagerecognizer.py
from flask import Flask
from flask import request
import simplejson as json
from decimal import Decimal
import numpy as np
import os
import sys
View Penn Treebank II Tags.md
@nlothian
nlothian / Trystack images JSON
Created Jul 17, 2012
JSON returned from Trystack
View Trystack images JSON
{
"images":[
{
"status":"ACTIVE",
"updated":"2012-02-02T19:11:00Z",
"name":"oneiric-server-cloudimg-amd64",
"links":[
{
"href":"https://nova-api.trystack.org:9774/v1.1/<tenantId>/images/15",
"rel":"self"
@nlothian
nlothian / gist:3127581
Created Jul 17, 2012
OpenStack authentication return
View gist:3127581
{
"access": {
"token": {
"expires": "2012-04-23T23:54:00",
"id": "<id>",
"tenant": {
"id": "<tenantId>",
"name": "<username>"
}
},
You can’t perform that action at this time.