Browse Source

[MNT] change np.inf to None

ab_data
Gao Enhao 2 years ago
parent
commit
0a6429b410
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      examples/hwf/hwf_kb.py

+ 2
- 2
examples/hwf/hwf_kb.py View File

@@ -26,7 +26,7 @@ class HWF_KB(GroundKB):

def logic_forward(self, data_sample: ListData):
if not self._valid_candidate(data_sample):
return np.inf
return None
formula = data_sample["pred_pseudo_label"][0]
formula = [self.label2evaluable[f] for f in formula]
data_sample["Y"] = [eval("".join(formula))]
@@ -112,7 +112,7 @@ class HWF_KB(GroundKB):
x = (pre_x,) + post_x
data_sample = ListData(pred_pseudo_label=[x])
y = self.logic_forward(data_sample)
if y is not np.inf:
if y is not None:
XY_list.append((x, y))
return XY_list



Loading…
Cancel
Save