Skip to content

Instantly share code, notes, and snippets.

View noname01's full-sized avatar

Jingchen Hu noname01

  • University of Washington
  • Seattle
View GitHub Profile
@noname01
noname01 / tf_seq2seq_single_str_inference.py
Created April 30, 2017 18:25
Quick hack for loading seq2seq model and inference via feed_dict.
from pydoc import locate
import tensorflow as tf
import numpy as np
from seq2seq import tasks, models
from seq2seq.training import utils as training_utils
from seq2seq.tasks.inference_task import InferenceTask, unbatch_dict
class DecodeOnce(InferenceTask):
'''
@MInner
MInner / top_k_seq2seq.py
Last active October 25, 2017 02:46
This snipped extracts top k beams from the beam search output of github.com/google/seq2seq.
# based on https://github.com/google/seq2seq/blob/master/bin/tools/generate_beam_viz.py
# extracts probabilities and sequences from .npz file generated during beam search.
# and pickles a list of the length n_samples that has beam_width most probable tuples
# (path, logprob, prob)
# where probs are scaled to 1.
import numpy as np
import networkx as nx
import pickle
@vasanthk
vasanthk / System Design.md
Last active June 7, 2024 23:09
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@baldwicc
baldwicc / solarized_setup.js
Last active February 9, 2024 15:38
Solarized Light and Solarized Dark for Chrome Secure Shell (nassh), with fonts
/**
* STEP 1: Setup
* - Open Chrome Secure Shell settings
* - Open JS Console (CTRL+SHIFT+J)
* - Copy and paste the following:
*/
var s7d_colours = {
'base03': '#002b36',
'base02': '#073642',
'base01': '#586e75',
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 5, 2024 06:45
A badass list of frontend development resources I collected over time.
@akesling
akesling / mnist.py
Last active June 28, 2023 21:13
MNist loading helper for Python 2.7. For Python 3.x, see https://gist.github.com/akesling/42393ccb868125071fdea77d98a0d2f0
import os
import struct
import numpy as np
"""
MNist loading helper for Python 2.7.
For Python 3.x, see https://gist.github.com/akesling/42393ccb868125071fdea77d98a0d2f0
Loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py