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 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, |
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 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) |
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
""" | |
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 |
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 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)) | |
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
# coding: utf-8 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn import ensemble, datasets | |
import brica1 | |
# RandomForeestClassifier Component Definition |
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
# coding: utf-8 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn import ensemble, svm,datasets | |
import brica1 | |
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 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 |
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
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"); |