Inverse hyperbolic-sine transformation used by `.AsinhScale`
| 642 | |
| 643 | |
| 644 | class AsinhTransform(Transform): |
| 645 | """Inverse hyperbolic-sine transformation used by `.AsinhScale`""" |
| 646 | input_dims = output_dims = 1 |
| 647 | |
| 648 | def __init__(self, linear_width): |
| 649 | super().__init__() |
| 650 | if linear_width <= 0.0: |
| 651 | raise ValueError("Scale parameter 'linear_width' " + |
| 652 | "must be strictly positive") |
| 653 | self.linear_width = linear_width |
| 654 | |
| 655 | def transform_non_affine(self, values): |
| 656 | return self.linear_width * np.arcsinh(values / self.linear_width) |
| 657 | |
| 658 | def inverted(self): |
| 659 | return InvertedAsinhTransform(self.linear_width) |
| 660 | |
| 661 | |
| 662 | class InvertedAsinhTransform(Transform): |
no outgoing calls
searching dependent graphs…