Skip to content

Instantly share code, notes, and snippets.

View zhongwen's full-sized avatar

Zhongwen Xu zhongwen

View GitHub Profile
@zhongwen
zhongwen / tmux.conf
Last active December 9, 2016 14:18 — forked from shinzui/tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
@zhongwen
zhongwen / pegasos.py
Created February 16, 2014 06:13 — forked from alextp/pegasos.py
class OnlineLearner(object):
def __init__(self, **kwargs):
self.last_misses = 0.
self.iratio = 0.
self.it = 1.
self.l = kwargs["l"]
self.max_ratio = -np.inf
self.threshold = 500.
def hinge_loss(self, vector, cls, weight):