@@ -93,7 +93,7 @@ class LogTransformBase(Transform):
93
93
is_separable = True
94
94
has_inverse = True
95
95
96
- def __init__ (self , nonpos ):
96
+ def __init__ (self , nonpos = 'clip' ):
97
97
Transform .__init__ (self )
98
98
self ._clip = {"clip" : True , "mask" : False }[nonpos ]
99
99
@@ -114,6 +114,10 @@ def transform_non_affine(self, a):
114
114
out [a <= 0 ] = - 1000
115
115
return out
116
116
117
+ def __str__ (self ):
118
+ return "{}({!r})" .format (type (self ).__name__ ,
119
+ "clip" if self ._clip else "mask" )
120
+
117
121
118
122
class InvertedLogTransformBase (Transform ):
119
123
input_dims = 1
@@ -124,6 +128,9 @@ class InvertedLogTransformBase(Transform):
124
128
def transform_non_affine (self , a ):
125
129
return ma .power (self .base , a )
126
130
131
+ def __str__ (self ):
132
+ return "{}()" .format (type (self ).__name__ )
133
+
127
134
128
135
class Log10Transform (LogTransformBase ):
129
136
base = 10.0
@@ -168,7 +175,7 @@ def inverted(self):
168
175
169
176
170
177
class LogTransform (LogTransformBase ):
171
- def __init__ (self , base , nonpos ):
178
+ def __init__ (self , base , nonpos = 'clip' ):
172
179
LogTransformBase .__init__ (self , nonpos )
173
180
self .base = base
174
181
@@ -448,7 +455,7 @@ class LogitTransform(Transform):
448
455
is_separable = True
449
456
has_inverse = True
450
457
451
- def __init__ (self , nonpos ):
458
+ def __init__ (self , nonpos = 'mask' ):
452
459
Transform .__init__ (self )
453
460
self ._nonpos = nonpos
454
461
self ._clip = {"clip" : True , "mask" : False }[nonpos ]
@@ -465,6 +472,10 @@ def transform_non_affine(self, a):
465
472
def inverted (self ):
466
473
return LogisticTransform (self ._nonpos )
467
474
475
+ def __str__ (self ):
476
+ return "{}({!r})" .format (type (self ).__name__ ,
477
+ "clip" if self ._clip else "mask" )
478
+
468
479
469
480
class LogisticTransform (Transform ):
470
481
input_dims = 1
@@ -483,6 +494,9 @@ def transform_non_affine(self, a):
483
494
def inverted (self ):
484
495
return LogitTransform (self ._nonpos )
485
496
497
+ def __str__ (self ):
498
+ return "{}({!r})" .format (type (self ).__name__ , self ._nonpos )
499
+
486
500
487
501
class LogitScale (ScaleBase ):
488
502
"""
0 commit comments