コード例 #1
0
ファイル: generic_models.py プロジェクト: crajib2003/cs_hdmr
        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
            )
コード例 #2
0
ファイル: generic_models.py プロジェクト: jsgphd/cs_hdmr
        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)
コード例 #3
0
ファイル: generic_models.py プロジェクト: jsgphd/cs_hdmr
 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])
コード例 #4
0
ファイル: generic_models.py プロジェクト: crajib2003/cs_hdmr
 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])