/third_party/mindspore/tests/ut/python/nn/probability/distribution/ |
D | test_exponential.py | 118 def construct(self, rate_b, rate_a): argument 119 kl1 = self.e1.kl_loss('Exponential', rate_b) 120 kl2 = self.e2.kl_loss('Exponential', rate_b, rate_a) 128 rate_b = Tensor([0.3], dtype=dtype.float32) 130 ans = net(rate_b, rate_a) 142 def construct(self, rate_b, rate_a): argument 143 h1 = self.e1.cross_entropy('Exponential', rate_b) 144 h2 = self.e2.cross_entropy('Exponential', rate_b, rate_a) 152 rate_b = Tensor([0.3], dtype=dtype.float32) 154 ans = net(rate_b, rate_a)
|
D | test_gamma.py | 131 def construct(self, concentration_b, rate_b, concentration_a, rate_a): argument 132 kl1 = self.g1.kl_loss('Gamma', concentration_b, rate_b) 133 kl2 = self.g2.kl_loss('Gamma', concentration_b, rate_b, concentration_a, rate_a) 142 rate_b = Tensor(np.array([1.0]).astype(np.float32), dtype=dtype.float32) 145 ans = net(concentration_b, rate_b, concentration_a, rate_a) 157 def construct(self, concentration_b, rate_b, concentration_a, rate_a): argument 158 h1 = self.g1.cross_entropy('Gamma', concentration_b, rate_b) 159 h2 = self.g2.cross_entropy('Gamma', concentration_b, rate_b, concentration_a, rate_a) 168 rate_b = Tensor(np.array([1.0]).astype(np.float32), dtype=dtype.float32) 171 ans = net(concentration_b, rate_b, concentration_a, rate_a)
|
/third_party/mindspore/mindspore/nn/probability/distribution/ |
D | exponential.py | 215 def _cross_entropy(self, dist, rate_b, rate=None): argument 225 return self._entropy(rate) + self._kl_loss(dist, rate_b, rate) 295 def _kl_loss(self, dist, rate_b, rate=None): argument 305 rate_b = self._check_value(rate_b, 'rate_b') 306 rate_b = self.cast(rate_b, self.parameter_type) 308 return self.log(rate_a) - self.log(rate_b) + rate_b / rate_a - 1.0
|
D | gamma.py | 262 def _cross_entropy(self, dist, concentration_b, rate_b, concentration_a=None, rate_a=None): argument 275 self._kl_loss(dist, concentration_b, rate_b, concentration_a, rate_a) 314 def _kl_loss(self, dist, concentration_b, rate_b, concentration_a=None, rate_a=None): argument 332 rate_b = self._check_value(rate_b, 'rate_b') 334 rate_b = self.cast(rate_b, self.parameter_type) 338 + concentration_b * self.log(rate_a) - concentration_b * self.log(rate_b) \ 339 + concentration_a * (rate_b / rate_a - 1.)
|
/third_party/mindspore/tests/st/probability/distribution/ |
D | test_gamma.py | 92 rate_b = np.array([1.0]).astype(np.float32) 96 + concentration_b * np.log(rate_a) - concentration_b * np.log(rate_b) \ 97 + concentration_a * (rate_b / rate_a - 1.) 101 rate = Tensor(rate_b, dtype=dtype.float32) 316 rate_b = np.array([1.0]).astype(np.float32) 317 ans = prob(Tensor(concentration_b), Tensor(rate_b)) 321 + concentration_b * np.log(rate_a) - concentration_b * np.log(rate_b) \ 322 + concentration_a * (rate_b / rate_a - 1.)
|
D | test_exponential.py | 88 rate_b = np.array([0.5, 2.0]).astype(np.float32) 89 expect_kl_loss = np.log(rate_a) - np.log(rate_b) + rate_b / rate_a - 1.0 91 output = kl(Tensor(rate_b, dtype=dtype.float32))
|
/third_party/pulseaudio/src/pulsecore/ |
D | resampler.c | 140 const uint32_t rate_b) { in fix_method() argument 143 pa_assert(pa_sample_rate_valid(rate_b)); in fix_method() 147 if (!(flags & PA_RESAMPLER_VARIABLE_RATE) && rate_a == rate_b) { in fix_method() 159 if (rate_a != rate_b) { in fix_method() 178 if (rate_a < rate_b) { in fix_method()
|