Esempio n. 1
0
def read_matrix(f):
    """
    read matrix from file, to globalD, globalH
    """
    content = f.readline().split("\t")
    globalD = content[1].strip("\n")
    globalH = content[2].strip("\n")

    globalD = generate_array(globalD, element_type=np.float64)
    globalH = generate_array(globalH, element_type=np.float64)

    return (globalD, globalH)
Esempio n. 2
0
def read_matrix(f):
    """
    read matrix from file, to globalD, globalH
    """
    content = f.readline().split("\t")
    globalD = content[1].strip("\n")
    globalH = content[2].strip("\n")

    globalD = generate_array(globalD, element_type=np.float64)
    globalH = generate_array(globalH, element_type=np.float64)

    return (globalD, globalH)
Esempio n. 3
0
    def load_models(self):
        """
        load models from the file
        """
        f = open(self.params["models_filename"])
        content = f.readlines()
        content = content[0].strip('\n').split('\t')

        self.w_suffix_matrix = generate_array(content[2],
                                              element_type=np.float64)

        self.w_matrix = generate_array(content[4], element_type=np.float64)
        self.w_matrix = np.transpose(self.w_matrix)

        f.close()
Esempio n. 4
0
    def load_models(self):
        """
        load models from the file
        """
        f = open(self.params["models_filename"])
        content = f.readlines()
        content = content[0].strip('\n').split('\t')

        self.w_suffix_matrix = generate_array(content[2],
                                              element_type=np.float64)

        self.w_matrix = generate_array(content[4],
                                       element_type=np.float64)
        self.w_matrix = np.transpose(self.w_matrix)

        f.close()