Skip to content

Instantly share code, notes, and snippets.

scturtle

Block or report user

Report or block scturtle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@scturtle
scturtle / .stalonetrayrc
Last active Aug 5, 2017
xmonad simple config
View .stalonetrayrc
icon_gravity E
geometry 5x1-0+0
max_geometry 5x1-0+0
background "#000000"
icon_size 20
kludges force_icons_size
skip_taskbar
@scturtle
scturtle / gan.py
Last active Jun 21, 2017
GAN a Gaussian distribution
View gan.py
from __future__ import print_function
import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.contrib.layers as tfl
import tensorflow.contrib.framework as tff
def minibatch(features):
size_a, size_b, size_c = features.get_shape()[1], 3, 3
View pf.py
import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.patches import Arrow, Circle
fig = plt.figure("pf", figsize=(7., 7.))
ax = fig.gca()
landmarks = [[20., 20.], [20., 50.], [20., 80.],
@scturtle
scturtle / lstm.py
Created Apr 13, 2017
Character prediction with LSTM in Tensorflow
View lstm.py
from __future__ import print_function
import string
import zipfile
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as layers
class BatchGenerator:
def __init__(self, text, vocabulary, batch_size, num_unrollings):
@scturtle
scturtle / tf_lstm.py
Created Apr 12, 2017 — forked from siemanko/tf_lstm.py
Simple implementation of LSTM in Tensorflow in 50 lines (+ 130 lines of data generation and comments)
View tf_lstm.py
from __future__ import print_function
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as layers
def as_bytes(num, final_size):
res = []
for _ in range(final_size):
res.append(num % 2)
num //= 2
@scturtle
scturtle / icp.py
Created Mar 31, 2017
Least-Squares Fitting of Two 3-D Point Sets
View icp.py
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from transforms3d import euler
fig = plt.figure()
ax = fig.gca(projection='3d')
p1 = np.zeros((3, 100))
p1[0, :] = np.linspace(1, 3, 100)
@scturtle
scturtle / lm.py
Created Mar 24, 2017
levenberg marquardt algorithm
View lm.py
import numpy as np
import numpy.linalg as npl
from easydict import EasyDict
opts = EasyDict(dict(max_iter=10, eps1=1e-8, eps2=1e-8))
def fJ(x, p, y=0):
f = p[0] * np.exp(- (x - p[1]) ** 2 / (2 * p[2] ** 2))
J = np.empty((p.size, x.size), dtype=np.float)
J[0, :] = f / p[0]
@scturtle
scturtle / kalman.py
Last active Apr 27, 2017
kalman filter
View kalman.py
import numpy as np
from numpy.linalg import inv
import matplotlib.pyplot as plt
delta_t = 0.1
t = np.arange(0, 5, delta_t)
n = len(t)
# 加速度
g = 10
# 真实位置
@scturtle
scturtle / ransac.ipynb
Created Sep 25, 2016
ransac algorithm
View ransac.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scturtle
scturtle / move.py
Created Jul 23, 2016
Go! Pokemon go!
View move.py
import os
import bottle
ip = '233.233.233.233'
x = 51.505494
y = -0.12369
add = 0.0001
p1 = (55, 770)
p2 = (55, 820)
You can’t perform that action at this time.