Ejemplo n.º 1
0
        def get_entry(i, j):
            s1 = sym_sets[i]
            s2 = sym_sets[j]
            
            p1 = self.component_polys_dict[s1]
            p2 = self.component_polys_dict[s2]

            return sym_poly_utils.sample_dot(
                self.sample, p1, p2, normalize=True
            )
Ejemplo n.º 2
0
        def get_entry(i, j):
            s1 = sym_sets[i]
            s2 = sym_sets[j]

            p1 = self.component_polys_dict[s1]
            p2 = self.component_polys_dict[s2]

            return sym_poly_utils.sample_dot(self.sample,
                                             p1,
                                             p2,
                                             normalize=True)
Ejemplo n.º 3
0
 def cosparsity_index(self, sample, threshold=1.0e-5):
     """
     Returns the number of basis polynomials whose dot product with the
     model polynomial over the sample given is above the threshold.
     """
     basis_polys = [p for p, _ in self.basis_coeff_dict]
     dot_prods = [
         sym_poly_utils.sample_dot(sample,
                                   self.full_model_poly,
                                   p,
                                   normalize=True) for p in basis_polys
     ]
     return len([d for d in dot_prods if d > threshold])
Ejemplo n.º 4
0
 def cosparsity_index(self, sample, threshold=1.0e-5):
     """
     Returns the number of basis polynomials whose dot product with the
     model polynomial over the sample given is above the threshold.
     """
     basis_polys = [p for p, _ in self.basis_coeff_dict]
     dot_prods = [
         sym_poly_utils.sample_dot(
             sample, self.full_model_poly, p, normalize=True
         )
         for p in basis_polys
     ]
     return len([d for d in dot_prods if d > threshold])