Skip to content

Instantly share code, notes, and snippets.

View TakuTsuzuki's full-sized avatar

Taku Tsuzuki TakuTsuzuki

  • RIKEN Osaka-u
  • Osaka
View GitHub Profile
@TakuTsuzuki
TakuTsuzuki / Data_croper_from_imagej_roi.ijm
Last active November 17, 2015 08:51
Neuro_Astrocyte_classifier_in_chainer
imagedir = getDirectory("Choose a Directory");
savedir = "/Users/tsuzuki/PycharmProjects/cell_detection/OkadaLab/dataset";
nfolder=12
j=0
for (k=1; k<=nfolder; k++){
run("ROI Manager...");
roiManager("Open", imagedir+"/"+k+"/neuron.zip");
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
from sklearn import datasets
import brica1
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
from sklearn import ensemble, svm,datasets
import brica1
@TakuTsuzuki
TakuTsuzuki / brica1_RandomForestClassifierComponent.py
Created July 10, 2015 01:32
RandomForestClassifier Component of BriCA1
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
from sklearn import ensemble, datasets
import brica1
# RandomForeestClassifier Component Definition
@TakuTsuzuki
TakuTsuzuki / entropy2D.py
Last active August 29, 2015 14:22
PCA for image analysis
import numpy as np
def entropy(X):
#caluculate Entropy of 1D-list
X = np.array(X,dtype='f')
p = X/np.sum(X)
p = np.array([x for x in p if x>0])
H = np.sum(-p*np.log2(p))
"""
pysom.py is a python script for self-organizing map (SOM).
"""
import numpy as np
import matplotlib.pyplot as plt
# learning paras.
loop = 1000 # def: 1000
alpha_base = 1.0 # def: 1.0
import numpy as np
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def sigmoid_deriv(x):
return x * (1 - x)
def softmax(x):
temp = np.exp(x)
@TakuTsuzuki
TakuTsuzuki / dA_5.py
Last active August 29, 2015 14:06
5th-layer denoising Autoencoder
import numpy
import argparse
import cPickle as pickle
import utils
class Autoencoder3(object):
def __init__(self, n_visible = 784, n_hidden1 = 784,
n_hidden2 = 784, n_hidden3 = 784,
n_hidden4 = 784, n_hidden5 = 784,