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
/* global d3, _ */ | |
var CONFIG = { | |
transitionDuration: 0, | |
stepDelay: 10, | |
// learning rate | |
alpha: 0.1, | |
// deviation from greediness | |
epsilon: 1e-2, | |
// reward discount factor |
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 copy | |
# fun from Ernest! | |
# | |
# Given two strings s and t, determine whether some anagram of t is a substring of s. | |
# For example: if s = "udacity" and t = "ad", then the function returns True. | |
# Your function definition should look like: question1(s, t) and return a boolean True or False. | |
def q_mike(s, t): | |
def add_to_hist(c, hist): |
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/env python | |
import itertools | |
import numpy as np | |
N = 1000 | |
d = 500 | |
x_normal = np.random.multivariate_normal([0], [[1]], [N, d]).reshape([N, d]) | |
x_spherical = x_normal / np.linalg.norm(x_normal, axis=1)[:, np.newaxis] |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js"> </script> | |
<script src="https://d3js.org/d3.v5.min.js"></script> | |
<style type="text/css"> | |
.timeline { | |
pointer-events: all; | |
} |
OlderNewer