Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignored LLPO in the removed nodes; using 0.0 for floating point error #75

Merged
merged 3 commits into from
Jul 8, 2024
Merged
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
17 changes: 16 additions & 1 deletion causing/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

from dataclasses import dataclass, field
from typing import Iterable, Callable
from functools import cached_property
Expand Down Expand Up @@ -82,8 +83,22 @@ def compute(
eq_inputs[:, fixed_from_ind] = fixed_vals

try:
# print(f"Comuting variable: {self.yvars[i]}")
# yhat[i] = np.array(
# [eq(*eq_in, *parameters.values()) for eq_in in eq_inputs],
# dtype=np.float64,
# )
computed_yvars = []
for eq_in in eq_inputs:
try:
computed_yvars.append(eq(*eq_in, *parameters.values()))
except FloatingPointError:
# Floating Point Error for self.yvars[i]
# Adding 0.0 to overcome this.
computed_yvars.append(0.0)

yhat[i] = np.array(
[eq(*eq_in, *parameters.values()) for eq_in in eq_inputs],
computed_yvars,
dtype=np.float64,
)
except Exception as e:
Expand Down
Loading