MCPcopy Index your code
hub / github.com/PyGCL/PyGCL / get_feature_weights

Function get_feature_weights

GCL/augmentors/functional.py:114–122  ·  view source on GitHub ↗
(x, centrality, sparse=True)

Source from the content-addressed store, hash-verified

112
113
114def get_feature_weights(x, centrality, sparse=True):
115 if sparse:
116 x = x.to(torch.bool).to(torch.float32)
117 else:
118 x = x.abs()
119 w = x.t() @ centrality
120 w = w.log()
121
122 return normalize(w)
123
124
125def drop_feature_by_weight(x, weights, drop_prob: float, threshold: float = 0.7):

Callers

nothing calls this directly

Calls 1

normalizeFunction · 0.90

Tested by

no test coverage detected