Skip to content

Instantly share code, notes, and snippets.

View yamaguchiyuto's full-sized avatar

Yuto Yamaguchi yamaguchiyuto

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yamaguchiyuto
yamaguchiyuto / ilfm.py
Created March 16, 2017 14:27
Infinite Latent Feature Model
import numpy as np
import scipy.sparse
class ILFM:
def __init__(self, var_x=1.0, var_y=1.0, alpha=1.0, max_iter=30, max_sampled_new_features=10):
self.var_x=var_x
self.var_y=var_y
self.alpha=alpha
self.max_iter=max_iter
self.max_sampled_new_features=max_sampled_new_features
@yamaguchiyuto
yamaguchiyuto / dpgmm.ipynb
Created March 14, 2017 01:41
DPGMM experiment
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yamaguchiyuto
yamaguchiyuto / dpgmm.py
Created March 13, 2017 14:26
Dirichlet Process Gaussian Mixture Model
import numpy as np
class DPGMM:
def __init__(self,alpha=1,mu0=0,rho0=1,a0=1,b0=1,max_iter=30):
self.alpha = alpha
self.mu0=mu0
self.rho0=rho0
self.a0=a0
self.b0=b0
self.max_iter=max_iter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
class Tucker:
def __init__(self,R,S,T,max_iter):
self.latent_size = (R,S,T)
self.max_iter=max_iter
def _calc_data_shape(self,X):
max_i = -1
max_j = -1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
class CPALS:
def __init__(self,k,lamb,max_iter):
self.k=k
self.lamb=lamb
self.max_iter=max_iter
def _calc_data_shape(self,X):
max_i = -1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.