Python
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
# Mathieu Blondel, May 2012 | |
# License: BSD 3 clause | |
import numpy as np | |
def euclidean_distances(X, Y=None, Y_norm_squared=None, squared=False): | |
XX = np.sum(X * X, axis=1)[:, np.newaxis] | |
YY = np.sum(Y ** 2, axis=1)[np.newaxis, :] | |
distances = np.dot(X, Y.T) | |
distances *= -2 |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
from jr.plot import pretty_plot, plot_eb # available @ http://github.com/kingjr/jr-tools | |
# make up data | |
x = np.linspace(1., 5., 100) | |
all_data = dict(AG=np.sin(x), V1=np.cos(x), IPS=np.cos(x + 1.5)) | |
# choose color manually | |
colors = ['r', [.1, 1., .2, 1.], 'b'] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.