Skip to content

Instantly share code, notes, and snippets.

@jcrubino
jcrubino / rbm.py
Created August 13, 2012 17:17
Some fairly clean (and fast) code for Restricted Boltzmann machines.
"""
Code for training RBMs with contrastive divergence. Tries to be as
quick and memory-efficient as possible while utilizing only pure Python
and NumPy.
"""
# Copyright (c) 2009, David Warde-Farley
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@jcrubino
jcrubino / online.py
Created August 13, 2012 17:12 — forked from alextp/online.py
A hacky, old, python implementation of leon bottou's lasvm
# coding: utf-8
"""Online learning."""
import numpy as np
from numpy import sign
import itertools as it
from numpy import array as A, zeros as Z
import math