File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 30
30
TensorLike = np .ndarray | pt .TensorVariable
31
31
32
32
33
- def set_boundary (Xs : TensorLike , c : numbers .Real | TensorLike ) -> np .ndarray :
34
- """Set the boundary using the `Xs ` and `c`. `Xs` must be centered around zero, and `c`
35
- is usually a scalar multiplier greater than 1.0, but it may also be one value per dimension
36
- or column of `Xs `.
33
+ def set_boundary (X : TensorLike , c : numbers .Real | TensorLike ) -> np .ndarray :
34
+ """Set the boundary using `X ` and `c`. `X` can be centered around zero but doesn't have to be,
35
+ and `c` is usually a scalar multiplier greater than 1.0, but it may also be one value per
36
+ dimension or column of `X `.
37
37
"""
38
- S = pt . max (
39
- pt .abs ( Xs ) , axis = 0
40
- ) # important: the Xs should have previously been centered around 0
38
+ # compute radius. Works whether X is 0-centered or not
39
+ S = ( pt . max ( X , axis = 0 ) - pt .min ( X , axis = 0 )) / 2. 0
40
+
41
41
L = (c * S ).eval () # eval() makes sure L is not changed with out-of-sample preds
42
42
return L
43
43
You can’t perform that action at this time.
0 commit comments