I hereby claim:
- I am zmjjmz on github.
- I am zach (https://keybase.io/zach) on keybase.
- I have the public key with fingerprint 2184 B50B 782E 9A0F 0915 016B 4C67 75A0 5B06 0619
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
a = np.cos(norm_lines[:,1]) | |
b = np.sin(norm_lines[:,1]) | |
x0 = a*norm_lines[:,0] | |
y0 = b*norm_lines[:,0] | |
norm_line_segs = np.vstack([x0-segment_length*b, | |
y0+segment_length*a, | |
x0+segment_length*b, | |
y0-segment_length*a]).T | |
norm_line_segs = np.vectorize(int)(norm_line_segs) |
for line in norm_lines: | |
a = np.cos(line[1]) | |
b = np.sin(line[1]) | |
x0 = a*line[0] | |
y0 = b*line[0] | |
#print(a, b) | |
#print(line[1]*180/np.pi) | |
#line_func = lambda t: (x0 + b*t, y0 - a*t) | |
#norm_line_seg = np.hstack([line_func(segment_length), line_func(-1*segment_length)]) | |
norm_line_seg = [x0 - segment_length*b, |
from __future__ import division | |
import os | |
import sys | |
import subprocess | |
import time | |
import numpy as np | |
import tensorflow | |
from tensorflow.python.tools import inspect_checkpoint |
def export_keras_model_simple(model, export_dir, version, input_name_map={}, output_name_map={}, model_name=None, conflict_policy='fail', | |
exclude_outputs=[], verbose=True): | |
# only supports one input / one output models | |
# version is supposed to be an uint! | |
model_format = 'keras' | |
version_str = str(version) | |
if datautil.is_valid_path(model): | |
if verbose: |
def keras_avgpool_linear_pad_endtoend(word_map_emb_pair, pad_length, | |
n_classes, random_seed, oov_thresh=0.9, embed_config={}, model_config={}): | |
# expect these in the order filter_embeddings returns them | |
# nastyyy | |
word_ind_map, embedding_mat = word_map_emb_pair | |
numpy.random.seed(random_seed) | |
inp = keras.layers.Input(shape=(1,), name='text', dtype='string') | |
# assume word_ind_map and embedding_mat has been fucked with according |
class TokenizeLookupLayer(keras.layers.Layer): | |
""" | |
Layer that encapsulates the following: | |
- Tokenizing sentences by space (or given delimiter) | |
- Looking up the words with a given vocabulary list / table | |
- Resetting the shape of the above to be batch_size x pad_len (using dark magic) | |
# Input Shape | |
2D string tensor with shape `(batch_size, 1)` | |
# Output Shape | |
2D int32 tensor with shape `(batch_size, pad_len)` |
from __future__ import division | |
import os | |
import sys | |
import subprocess | |
import time | |
import numpy as np | |
import tensorflow | |
from tensorflow.python.tools import inspect_checkpoint |
Using TensorFlow backend. | |
2017-12-20 14:02:35.782187: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA | |
output from keras | |
[[[ 0. 0. 0.] | |
[ 0. 0. 0.] | |
[ 0. 0. 0.] | |
[ 0. 0. 0.] | |
[ 0. 0. 0.]] | |
[[ 0. 0. 0.] |
Using TensorFlow backend. | |
2017-12-20 14:04:22.144670: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA | |
output from keras | |
[[[ 0. 0. 0.] | |
[ 0. 0. 0.] | |
[ 0. 0. 0.] | |
[ 0. 0. 0.] | |
[ 0. 0. 0.]] | |
[[ 0. 0. 0.] |