From 17813a5f39b087914a0a1a38e128bb7bed6e3c93 Mon Sep 17 00:00:00 2001 From: lars Date: Tue, 22 Oct 2024 14:01:53 +0200 Subject: [PATCH] add more naming conventions to constrain --- bayesflow/data_adapters/transforms/constrain.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bayesflow/data_adapters/transforms/constrain.py b/bayesflow/data_adapters/transforms/constrain.py index a20c8f2c..ea44f5e4 100644 --- a/bayesflow/data_adapters/transforms/constrain.py +++ b/bayesflow/data_adapters/transforms/constrain.py @@ -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 @@ -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 @@ -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