Skip to content

Instantly share code, notes, and snippets.

@nikitakit
nikitakit / TensorflowModel.scala
Created July 8, 2016 01:35
Opening Tensorflow models in scala
package epic.tensorflow
import org.bytedeco.javacpp.{tensorflow, BytePointer}
import org.bytedeco.javacpp.tensorflow.GraphDef
/**
* Created by kitaev on 1/22/16.
*/
class TensorflowModel(filename: String) {
@nikitakit
nikitakit / tf_beam_decoder.py
Last active January 6, 2024 08:48
Tensorflow Beam Search
"""
Beam decoder for tensorflow
Sample usage:
```
from tf_beam_decoder import beam_decoder
decoded_sparse, decoded_logprobs = beam_decoder(
cell=cell,
@nikitakit
nikitakit / _NOTICE.md
Last active December 15, 2018 21:13
Restoring TensorFlow Models
@nikitakit
nikitakit / gist:6473230
Created September 7, 2013 06:12
IPython SimpleCV plugin
"""Plugin to display SimpleCV images inline in the IPython notebook"""
from cStringIO import StringIO
def display_image(img):
io = StringIO()
img.save(io, 'png')
return io.getvalue()
ip = get_ipython()
png_formatter = ip.display_formatter.formatters['image/png']
png_formatter.for_type(SimpleCV.ImageClass.Image, display_image)
First Gist
Update
Nikita making an edit
Another Update