Skip to content

Commit

Permalink
Use jnp.clip for applying constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
BirkhoffG committed May 28, 2024
1 parent c722a81 commit 7a56e65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nbs/data_utils/transform.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
" super().__init__(\"minmax\", MinMaxScaler())\n",
"\n",
" def apply_constraints(self, xs, cfs, **kwargs):\n",
" return np.clip(cfs, 0., 1.)"
" return jnp.clip(cfs, 0., 1.)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion relax/data_utils/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(self):
super().__init__("minmax", MinMaxScaler())

def apply_constraints(self, xs, cfs, **kwargs):
return np.clip(cfs, 0., 1.)
return jnp.clip(cfs, 0., 1.)

# %% ../../nbs/data_utils/transform.ipynb 9
class _OneHotTransformation(_DefaultTransformation):
Expand Down

0 comments on commit 7a56e65

Please sign in to comment.