File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
models/src/anemoi/models/preprocessing Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,9 @@ def log1p_converter(x):
4242
4343def boxcox_converter (x , lambd = 0.5 ):
4444 """Convert positive var in to boxcox(var)."""
45- pos_lam = (torch .pow (x , lambd ) - 1 ) / lambd
46- null_lam = torch .log (x )
4745 if lambd == 0 :
48- return null_lam
49- else :
50- return pos_lam
46+ return torch .log (x )
47+ return (torch .pow (x , lambd ) - 1 ) / lambd
5148
5249
5350def sqrt_converter (x ):
@@ -67,9 +64,6 @@ def square_converter(x):
6764
6865def inverse_boxcox_converter (x , lambd = 0.5 ):
6966 """Convert back boxcox(var) to var."""
70- pos_lam = torch .pow (x * lambd + 1 , 1 / lambd )
71- null_lam = torch .exp (x )
7267 if lambd == 0 :
73- return null_lam
74- else :
75- return pos_lam
68+ return torch .exp (x )
69+ return torch .pow (x * lambd + 1 , 1 / lambd )
You can’t perform that action at this time.
0 commit comments