Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions snorkel/classification/multitask_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def forward( # type: ignore
# one field; use that as the input to the current op
op_name = op_input
inputs.append(outputs[op_name])

output = self.module_pool[operation.module_name].forward(
*inputs
)
Expand All @@ -220,8 +221,10 @@ def forward( # type: ignore
output = self.module_pool[operation.module_name].forward(
outputs
)
except Exception:
raise ValueError(f"Unsuccessful operation {operation}.")
except Exception as e:
raise ValueError(
f"Unsuccessful operation {operation}: {repr(e)}."
)
outputs[operation.name] = output

return outputs
Expand Down
2 changes: 1 addition & 1 deletion test/classification/test_classifier_convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def create_data(n: int, offset=0) -> pd.DataFrame:

Create labels with linear decision boundaries related to the two coordinates of X.
"""
X = np.random.random((n, 2)) * 2 - 1
X = (np.random.random((n, 2)) * 2 - 1).astype(np.float32)
Y = (X[:, 0] < X[:, 1] + offset).astype(int)

df = pd.DataFrame({"x1": X[:, 0], "x2": X[:, 1], "y": Y})
Expand Down
2 changes: 1 addition & 1 deletion test/slicing/test_convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_performance(self):


def create_data(n: int) -> pd.DataFrame:
X = np.random.random((n, 2)) * 2 - 1
X = (np.random.random((n, 2)) * 2 - 1).astype(np.float32)
Y = (X[:, 0] < X[:, 1] + 0.25).astype(int)

df = pd.DataFrame({"x1": X[:, 0], "x2": X[:, 1], "y": Y})
Expand Down