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

Testing tanh in symbolic expressions #192

Merged
merged 1 commit into from
Jul 26, 2024
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
2 changes: 1 addition & 1 deletion simulai/residuals/_pytorch_residuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(
self.processing = processing
self.periodic_bc_protected_key = "periodic"

self.protected_funcs = ["cos", "sin", "sqrt", "exp"]
self.protected_funcs = ["cos", "sin", "sqrt", "exp", "tanh"]
self.protected_operators = ["L", "Div", "Identity", "Kronecker"]

self.protected_funcs_subs = self._construct_protected_functions()
Expand Down
2 changes: 1 addition & 1 deletion tests/residuals/test_symbolicoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_symbolic_buitin_functions(self):
assert all([isinstance(item, torch.Tensor) for item in residual(input_data)])

def test_symbolic_operator_ode(self):
for token in ["sin", "cos", "sqrt"]:
for token in ["sin", "cos", "sqrt", "tanh"]:
f = f"D(u, t) - alpha*{token}(u)"

input_labels = ["t"]
Expand Down
Loading