Skip to content

Commit

Permalink
add more naming conventions to constrain
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsKue committed Oct 22, 2024
1 parent bfbbe92 commit 17813a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bayesflow/data_adapters/transforms/constrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(
raise ValueError("The lower bound must be strictly less than the upper bound.")

match method:
case "default" | "sigmoid":
case "default" | "sigmoid" | "logit":

def constrain(x):
return (upper - lower) * sigmoid(x) + lower
Expand All @@ -50,7 +50,7 @@ def constrain(x):

def unconstrain(x):
return inverse_softplus(x - lower)
case "exp":
case "exp" | "log":

def constrain(x):
return np.exp(x) + lower
Expand All @@ -71,7 +71,7 @@ def constrain(x):

def unconstrain(x):
return -inverse_softplus(-(x - upper))
case "exp":
case "exp" | "log":

def constrain(x):
return -np.exp(-x) + upper
Expand Down

0 comments on commit 17813a5

Please sign in to comment.