Пример #1
0
    def __init__(
        self,
        expe,
        frontend,
        assortativity=False,
        alpha_hyper_parameter=None,
        sigma_w_hyper_parameter=None,
        metropolis_hastings_k_new=True,
    ):
        self._sigma_w_hyper_parameter = sigma_w_hyper_parameter
        self.bilinear_matrix = None
        self.log_likelihood = None
        self.assortativity = assortativity
        self._overflow = 1.0
        self.ratio_MH_F = 0.0
        self.ratio_MH_W = 0.0
        self.snapshot_freq = 20

        self.burnin = expe.get('burnin',
                               5)  # (inverse burnin, last sample to keep
        self.thinning = expe.get('thinning', 1)
        self._csv_typo = '_iteration time_it _entropy _entropy_t _K _alpha _sigma_w Z_sum ratio_MH_F ratio_MH_W'
        #self._fmt = '%d %.4f %.8f %.8f %d %.8f %.8f %d %.4f %.4f'
        IBP.__init__(self, alpha_hyper_parameter, metropolis_hastings_k_new)
        GibbsSampler.__init__(self, expe, frontend)
Пример #2
0
Файл: mmsb.py Проект: dtrckd/ml
 def __init__(self, expe, frontend):
     self.comm = dict(
     )  # Empty dict to store communities and blockmodel structure
     self._measures = [
         '_iteration', 'time_it', '_entropy', '_entropy_t', '_K', '_alpha',
         '_gmma', 'alpha_mean', 'delta_mean', 'alpha_var', 'delta_var'
     ]
     #self._fmt = '%d %.4f %.8f %.8f %d %.8f %.8f %.4f %.4f %.4f %.4f'
     GibbsSampler.__init__(self, expe, frontend)
Пример #3
0
    def __init__(self, sampler,  data_t=None, **kwargs):

        self.burnin = kwargs.get('burnin',  0.05) # Ratio of iteration
        self.thinning = kwargs.get('thinning',  1)
        self.comm = dict() # Empty dict to store communities and blockmodel structure
        self.data_t = data_t
        self._csv_typo = 'it it_time entropy_train entropy_test K alpha gamma alpha_mean delta_mean alpha_var delta_var'
        self.fmt = '%d %.4f %.8f %.8f %d %.8f %.8f %.4f %.4f %.4f %.4f'
        #self.fmt = '%s %s %s %s %s %s %s %s %s %s %s'
        GibbsSampler.__init__(self, sampler, **kwargs)
Пример #4
0
Файл: lda.py Проект: dtrckd/ml
    def __init__(self, sampler, data_t=None, **kwargs):

        self.burnin = kwargs.get('burnin', 0.05)  # Ratio of iteration
        self.thinning = kwargs.get('thinning', 1)
        self.comm = dict(
        )  # Empty dict to store communities and blockmodel structure
        self.data_t = data_t
        self._measures = [
            'it', 'it_time', 'entropy_train', 'entropy_test', 'K', 'alpha',
            'gamma', 'alpha_mean', 'delta_mean', 'alpha_var', 'delta_var'
        ]
        self.fmt = '%d %.4f %.8f %.8f %d %.8f %.8f %.4f %.4f %.4f %.4f'
        #self.fmt = '%s %s %s %s %s %s %s %s %s %s %s'
        GibbsSampler.__init__(self, sampler, **kwargs)
Пример #5
0
 def __init__(self, expe, frontend):
     self.comm = dict(
     )  # Empty dict to store communities and blockmodel structure
     self._csv_typo = '_iteration time_it _entropy _entropy_t _K _alpha _gmma alpha_mean delta_mean alpha_var delta_var'
     #self._fmt = '%d %.4f %.8f %.8f %d %.8f %.8f %.4f %.4f %.4f %.4f'
     GibbsSampler.__init__(self, expe, frontend)