Skip to content

Instantly share code, notes, and snippets.

View vzhong's full-sized avatar

Victor Zhong vzhong

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
if [[ $- == *i* ]]
then
echo "Hello!"
else
exit 0
fi
# load zgen
source "${HOME}/config/zgen/zgen.zsh"
from keras.layers.embeddings import Embedding
from keras.models import Sequential
from keras.layers.recurrent import LSTM
from keras.layers.core import Dense, Activation, Dropout
model = Sequential()
model.add(Embedding(10, 20))
model.add(LSTM(20, 10))
model.add(Dropout(0.5))
model.add(Dense(10, 5))
require 'nn'
require 'dpnn'
require 'rnn'
require 'nngraph'
local opt = {
n_seq = 3,
d_hid = 4,
d_mem = 20,
n_batch = 2,
@vzhong
vzhong / Search.py
Created October 17, 2016 02:15
Basic search algorithms
"""
backtracking extended list informed
Depth First Search: y y n
Breadth First Search: n y n
Hill Climbing y y y
Beam Search: y y y
"""
import heapq
@vzhong
vzhong / CharToWordOffset.py
Created October 19, 2016 23:03
Converts from character offsets to word offsets
sents = [
'i like sandwiches',
'the Fr. madison is a great friar',
]
char_offsets = [
(2, 6),
(4, 15),
]
@vzhong
vzhong / init.vim
Last active March 20, 2017 09:51
nvim init file
" Enable plugged
call plug#begin('~/.vim/plugged')
"""""""""""""""""""""""""""""""
" My settings
"""""""""""""""""""""""""""""""
let mapleader = "\<Space>" "space as leader
set history=1000 " Store :cmdline history.
set showcmd " Show incomplete commands at the bottom
@vzhong
vzhong / hello.txt
Created October 12, 2017 20:02
Hello
hello world!
import random
import itertools
train_envs = [
['round plate', 'square plate'],
['round flat pot', 'round tall pot'],
['square flat pot', 'square tall pot'],
['round flat pot', 'square flat pot'],
{
"ours": [
{
"id": "gen:3988",
"query": "select last_name from Owners order by last_name",
"question": "list all the last name of owners in alphabetical order ."
},
{
"id": "gen:17117",
"query": "select count ( * ) from Friend",