Skip to content

Instantly share code, notes, and snippets.

View hurutoriya's full-sized avatar
🎯
Focusing

Shunya Ueta hurutoriya

🎯
Focusing
View GitHub Profile
@hurutoriya
hurutoriya / Gaussian kernel animation.ipynb
Created February 8, 2017 03:13
Gaussian Kerne animation by Python3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hurutoriya
hurutoriya / nb_1.ipynb
Last active February 2, 2017 02:29
nbdime example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hurutoriya
hurutoriya / weightedAverage.m
Last active February 1, 2017 08:28
Compute Weighted Average of Vector by MATLAB
function [weightedAve] = weightedAverage(data)
h = histogram(data);
k = ([min(data):max(data)]*h.Values')/length(data)
end
@hurutoriya
hurutoriya / filename_aveimage4GKLT.py
Last active December 5, 2016 02:40
Python Script for https://github.com/metalbubble/GKLT 1. make averageimage 2. make imgList.txt
import os, numpy, PIL
from PIL import Image
def all_image_file_name():
allfiles = os.listdir(os.getcwd())
# discriminate the JPEG format
imlist = [filename for filename in allfiles if filename.split(".")[-1] in ["jpg", "jpeg", "JPG"]]
image_file_list = "\n".join(imlist)
@hurutoriya
hurutoriya / preconditioning_tips.m
Created April 26, 2016 08:31
Preconditioning Matrix on Matlab
% be the symmetric matrix on computing enviroment.
% Twice A, divide 2.
A = 0.5*(A+A')
% Add upper triangle of A(include diagenal element) to lower triangle matrix of A.
A = triu(A)+triu(A,1)'
@hurutoriya
hurutoriya / power_iteration.m
Last active November 29, 2016 11:43
Visalization and Implemention of Power Method in MATLAB
res = 10^(-13);
A = [[1, 2, 0];
[2, 1, 1];
[0, 1, 0];]
[V, D] =eig(A)
eigen_value = diag(D);
norm(A*V(:,3)-eigen_value(3)*V(:,3))
x = [1; 0; 0]
ite = 0;
n = 5;
res = 10^(-13);
A = rand(n,n);
A = A'+A;
x = rand(n,1)
x_1 = A*x;
ite = 0;
while res < abs(norm(x_1)-norm(x))
@hurutoriya
hurutoriya / compare_variance_of_gaussian_kernel_in_graph.ipynb
Last active February 9, 2016 15:10
localscale vs empiric value in variance value of Gaussian kernel..ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hurutoriya
hurutoriya / Note.ipynb
Last active February 2, 2016 05:24
IPython Date Science Cook Book
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hurutoriya
hurutoriya / how-to-public-jupuyernotebook-on-remote-server.md
Last active January 29, 2016 05:00
How to public jupuyernotebook on remote server?

Access to remote server. and we user PYENV for set up python environment.

$ ssh your_remote_server
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
$ vim .zshrc
export PYENV_ROOT=$HOME/.pyenv
export PATH=$PYENV_ROOT/bin:$PATH