This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.utils import shuffle | |
# Data comes from y = f(x) = [2, 3].x + [5, 7] | |
X0 = np.random.randn(100, 2) - 1 | |
X1 = np.random.randn(100, 2) + 1 | |
X = np.vstack([X0, X1]) | |
t = np.vstack([np.zeros([100, 1]), np.ones([100, 1])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
import os | |
import zconfig | |
import utils | |
class RBM(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from math import exp | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def rbf_kernel(x1, x2, variance = 1): | |
return exp(-1 * ((x1-x2) ** 2) / (2*variance)) | |
def gram_matrix(xs): |