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 json | |
from keras.models import model_from_json | |
def convert_to_inference_model(original_model): | |
original_model_json = original_model.to_json() | |
inference_model_dict = json.loads(original_model_json) | |
layers = inference_model_dict['config'] | |
for layer in layers: | |
if 'stateful' in layer['config']: |
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 tensorflow as tf | |
from tensorflow.python.client import timeline | |
n = 1024 | |
with tf.device("cpu:0"): | |
a1 = tf.ones((n, n)) | |
a2 = tf.ones((n, n)) | |
with tf.device("cpu:1"): | |
a3 = tf.matmul(a1, a2) | |
with tf.device("cpu:2"): |
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
#!/bin/bash | |
mkdir my_project | |
cd my_project | |
echo " . . . Downloading file stanford-ner-2014-08-27.zip" | |
# NOTE: need to update link for further versions | |
wget http://nlp.stanford.edu/software/stanford-ner-2014-08-27.zip | |
echo " . . . Unpacking stanford-ner-2014-08-27.zip" |