コード例 #1
0
 def _forward(self, x):
     tailweight = tf.convert_to_tensor(self.tailweight)
     multiplier = self._output_multiplier(tailweight)
     bijector_output = tf.sinh((tf.asinh(x) + self.skewness) * tailweight)
     return bijector_output * multiplier
コード例 #2
0
 def _inverse(self, y):
     tailweight = tf.convert_to_tensor(self.tailweight)
     multiplier = self._output_multiplier(tailweight)
     return tf.sinh(tf.asinh(y / multiplier) / tailweight - self.skewness)
コード例 #3
0
 def _output_multiplier(self, tailweight):
     return self._scale_number / tf.sinh(
         tf.asinh(self._scale_number) * tailweight)
コード例 #4
0
     lower=-10.0,
     upper=100.0,
     antiderivative=lambda x: x**6 / 6,
 ),
 IntegrationTestCase(
     func=lambda x: (x**3 + x**2 - 4 * x + 1) / (x**2 + 1)**2,
     lower=0.0,
     upper=10.0,
     antiderivative=lambda x: sum([
         2.5 / (x**2 + 1),
         0.5 * np.log(x**2 + 1),
         np.arctan(x),
     ]),
 ),
 IntegrationTestCase(
     func=lambda x: (tf.sinh(2 * x) + 3 * tf.sinh(x)) /
     (tf.cosh(x)**2 + 2 * tf.cosh(0.5 * x)**2),
     lower=2.0,
     upper=4.0,
     antiderivative=lambda x: sum([
         np.log(np.cosh(x)**2 + np.cosh(x) + 1),
         (4 / np.sqrt(3)) * np.arctan((1 + 2 * np.cosh(x)) / np.sqrt(3.0)),
     ]),
 ),
 IntegrationTestCase(
     func=lambda x: tf.exp(2 * x) * tf.math.sqrt(tf.exp(x) + tf.exp(2 * x)),
     lower=2.0,
     upper=4.0,
     antiderivative=lambda x: sum([
         np.sqrt((np.exp(x) + np.exp(2 * x))**3) / 3,
         -(1 + 2 * np.exp(x)) * np.sqrt(np.exp(x) + np.exp(2 * x)) / 8,
コード例 #5
0
 def _inverse(self, y):
     return tf.sinh(tf.asinh(y) / self.tailweight - self.skewness)
コード例 #6
0
 def _forward(self, x):
     return tf.sinh((tf.asinh(x) + self.skewness) * self.tailweight)
コード例 #7
0
 def _forward(self, x):
     return tf.sinh(x)