<commit_before>#solarnmf_learn.py

#<NAME>
#2 April 2015

#Import needed modules
import numpy as np

class SeparateSources(object):
    """Class that performs BSS using specified method for given observation matrix"""
    
    def __init__(self,T,q,div_measure,update_rules,**kwargs):
        self.T = T
        self.div_measure = div_measure
        self.update_rules = update_rules
        self.q = q
        
        self.eps = 1.0e-5
        self.max_i = 500
        self.r = 10
        self.r_iter = 10
        
        #Give some output
        print "Using ",self.div_measure," divergence measure."
        print "Using ",self.update_rules," update rules."
        print "Guessed number of sources ",self.q
        
        
    def initialize_uva(self):
        """Initialize the u,v,A matrices by doing a preliminary minimization and using the u,v which give the smallest div."""
        
        ny,nx = self.T.shape
        
        u_temp,v_temp = np.random.rand(ny,self.q), np.random.rand(self.q,nx)
        a_temp = np.dot(u_temp,v_temp)
        u,v,A = u_temp, v_temp, a_temp<commit_msg>Small fixes for new class system<commit_after>#solarnmf_learn.py

#<NAME>
#2 April 2015

#Import needed modules
import numpy as np

class SeparateSources(object):
    """Class that performs BSS using specified method for given observation matrix"""
    
    def __init__(self,T,q,div_measure,update_rules,**kwargs):
        self.T = T
        self.div_measure = div_measure
        self.update_rules = update_rules
        self.q = q
        
        self.eps = 1.0e-5
        self.max_i = 500
        self.r = 10
        self.r_iter = 10
        
        print "Using ",self.div_measure," divergence measure."
        print "Using ",self.update_rules," update rules."
        print "Guessed number of sources ",self.q
        
        
    def initialize_uva(self):
        """Initialize the u,v,A matrices by doing a preliminary minimization and using the u,v which give the smallest div."""
        
        ny,nx = self.T.shape
        
        u_temp,v_temp = np.random.rand(ny,self.q), np.random.rand(self.q,nx)
        a_temp = np.dot(u_temp,v_temp)
        u,v,A = u_temp, v_temp, a_temp
{'fraction_non_alphanumeric': 0.09968138370505235, 'fraction_numerical': 0.013654984069185253, 'mean_word_length': 2.2562962962962962, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4965191', 'n_tokens_mistral': 718, 'n_tokens_neox': 683, 'n_words': 187}