Skip to content

Instantly share code, notes, and snippets.

View tomrunia's full-sized avatar

Tom Runia tomrunia

View GitHub Profile
filename_queue = tf.FIFOQueue(100000, [tf.string], shapes=[[]])
# ...
reader = tf.WholeFileReader()
image_filename, image_raw = reader.read(self._filename_queue)
image = tf.image.decode_jpeg(image_raw, channels=3)
# Image preprocessing
image_preproc = ...
import time
import numpy as np
import matplotlib.pyplot as plt
from Blockchain_test import return_data
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Embedding
from keras.layers import LSTM
import time
import numpy as np
import matplotlib.pyplot as plt
from Blockchain_test import return_data
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Embedding
from keras.layers import LSTM
@tomrunia
tomrunia / test_queue.py
Created June 24, 2016 08:57
Testing the performance of the TensorFlow FIFOQueue
import time
import numpy as np
import threading
import tensorflow as tf
from tensorflow.python.client import timeline
def test_queue():
# We must calculate the mean of each gradient. Note that this is the
# synchronization point across all towers.
grads_and_vars = average_gradients(t_grads)
# Optionally perform gradient clipping
if config.max_norm_gradient > 0:
grads, variables = zip(*grads_and_vars)
grads_clipped, _ = tf.clip_by_global_norm(grads, clip_norm=config.max_norm_gradient)
grads_and_vars = zip(grads_clipped, variables)
import os
import sys
import pickle
import numpy as np
import tensorflow as tf
from tensorflow.python.summary.event_accumulator import EventAccumulator
event_file = "/home/trunia1/dev/python/LSTMCounting/output/screens/" \
"summaries/004_rmsprop_0.0005_lstm_512x2_grad_10_batch_128_dropkp_0.75/" \
@tomrunia
tomrunia / barchart.html
Created May 30, 2016 12:17
Information Visualisation course
<!DOCTYPE html>
<meta charset="utf-8">
<!-- The visual styling of our barchart is in this file -->
<link rel="stylesheet" href="barchart.css">
<!-- This is the main container to which we append all chart elements -->
<svg class="chart"></svg>
<!-- We include D3 from an external location so that we don't have
@tomrunia
tomrunia / Chrome.sublime-build
Created May 19, 2016 18:33
SublimeText build for HTML/JavaScript to start Chrome with permissions to access local files
{
"cmd": ["open", "-a", "Google Chrome", "$file", "--args", "--allow-file-access-from-files"]
}

AlexNet

Classification done in 79.1ms [avg = 79.1ms] Probabilities and labels: n02124075 Egyptian cat (0.31) n02123159 tiger cat (0.18) n02123045 tabby, tabby cat (0.12) n02119022 red fox, Vulpes vulpes (0.11) n02085620 Chihuahua (0.04)

@tomrunia
tomrunia / README.md
Created March 3, 2016 15:23
Caffe model benchmarks: average classification time per image on MS-COCO (GPU Titan X)

Caffe Classification

Classification Speed Benchmark

Table lists average classification times per image (milliseconds). Averages are computed over classification of 100 images from MS-COCO validation set. For the VGG networks a very high variance in classification times was observed, some images were classified fast while most of them took more processing time that other network configurations.