I hereby claim:
- I am suzusuzu on github.
- I am suzusuzu (https://keybase.io/suzusuzu) on keybase.
- I have a public key ASBFQYSStcXvfZPPinQlrdVnRQ3qJCbsIUwtJYQOHPdDywo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
using Random | |
using LinearAlgebra | |
using DataStructures | |
using Base | |
mutable struct Node | |
data | |
friend::Set{Node} | |
end |
const arr = [...Array(100).keys()]; | |
const arr1 = arr.map(x => x*x % 2 == 0 ? x*x : null).filter((x): x is number => x !== null); | |
// arr1: number[] | |
const arr2 = arr.flatMap(x => x*x % 2 == 0 ? [x*x] : []) | |
// arr2: number[] |
using Cascadia | |
using Gumbo | |
using HTTP | |
using JSON | |
using DataFrames | |
using Dates | |
using Plots | |
# scraping | |
r = HTTP.request("GET", "https://paperswithcode.com/sota/image-classification-on-imagenet") |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.neighbors import NearestNeighbors | |
def kl_d_norm(mu1, sigma1, mu2, sigma2): | |
d = np.log(sigma2/sigma1) | |
d += (sigma1**2 + (mu1 - mu2)**2) / (2 * sigma2**2) | |
d -= 1/2 | |
return d |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
from mpl_toolkits.mplot3d import Axes3D | |
def kde(data, sigma): | |
def f(x): | |
l = x.shape[0] | |
res = np.zeros(l) | |
for i in range(l): |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.stats import gaussian_kde | |
import matplotlib.animation as animation | |
def gaussian_kernel(x, sigma): | |
return 1 / (np.sqrt(2*np.pi)*sigma) * np.exp(-(x**2)/(2*(sigma**2))) | |
def x_update(x, xi, sigma): | |
return np.sum(gaussian_kernel(xi - x, sigma) * x) / np.sum(gaussian_kernel(xi - x, sigma)) |
import numpy as np | |
def rosenbrock(x): | |
end = x.shape[0] | |
a = 100.0 | |
b = 1.0 | |
return np.sum(a * np.power((x[1:] - np.power(x[:end-1], 2)), 2) + np.power((x[:end-1] - b), 2)) | |
def cmaes(dim, f): | |
# User defined parameters |