Skip to content

Instantly share code, notes, and snippets.

Victor Zhong vzhong

Block or report user

Report or block vzhong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vzhong
vzhong / init.vim
Last active Mar 20, 2017
nvim init file
View init.vim
" 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 / CharToWordOffset.py
Created Oct 19, 2016
Converts from character offsets to word offsets
View CharToWordOffset.py
sents = [
'i like sandwiches',
'the Fr. madison is a great friar',
]
char_offsets = [
(2, 6),
(4, 15),
]
@vzhong
vzhong / Search.py
Created Oct 17, 2016
Basic search algorithms
View Search.py
"""
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
View memory.lua
require 'nn'
require 'dpnn'
require 'rnn'
require 'nngraph'
local opt = {
n_seq = 3,
d_hid = 4,
d_mem = 20,
n_batch = 2,
View example.py
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))
View gist:7e65d67b90f67d7c9bfd
if [[ $- == *i* ]]
then
echo "Hello!"
else
exit 0
fi
# load zgen
source "${HOME}/config/zgen/zgen.zsh"
View KB 500 epochs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.