Skip to content

Commit

Permalink
Merge pull request #192 from IBM/extend/symbolic
Browse files Browse the repository at this point in the history
Testing tanh in symbolic expressions
  • Loading branch information
Joao-L-S-Almeida authored Jul 26, 2024
2 parents 0871d10 + df4ff63 commit 23a953a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 23a953a

Please sign in to comment.