Skip to content

Instantly share code, notes, and snippets.

@JonathanRaiman
JonathanRaiman / viterbi.py
Last active Feb 4, 2020
tensorflow_viterbi_decode
View viterbi.py
import tensorflow as tf
def batch_gather_3d(values, indices):
return tf.gather(tf.reshape(values, [-1, tf.shape(values)[2]]),
tf.range(0, tf.shape(values)[0]) * tf.shape(values)[1] +
indices)
def batch_gather_2d(values, indices):
@blakebjorn
blakebjorn / pyqt threading example.py
Created Dec 12, 2016
PySide/PyQT non-blocking thread example
View pyqt threading example.py
from PySide import QtCore, QtGui
import sys
import time
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
#Build a UI
self.myLayout = QtGui.QVBoxLayout()
self.myCentralWidget = QtGui.QWidget()