Home
last modified time | relevance | path

Searched refs:sample_shape (Results 1 – 25 of 56) sorted by relevance

123

/external/tensorflow/tensorflow/contrib/distributions/python/kernel_tests/
Ddeterministic_test.py147 for sample_shape in [(), (4,)]:
149 sample = deterministic.sample(sample_shape)
150 self.assertAllEqual(sample_shape, sample.get_shape())
152 np.zeros(sample_shape).astype(np.float32), sample.eval())
156 for sample_shape in [(), (4,)]:
158 sample = deterministic.sample(sample_shape)
159 self.assertAllEqual(sample_shape + (2,), sample.get_shape())
161 np.zeros(sample_shape + (2,)).astype(np.float32), sample.eval())
165 sample_shape = array_ops.placeholder(np.int32)
170 sample_ = deterministic.sample(sample_shape).eval(
[all …]
Ddistribution_test.py52 for sample_shape in sample_shapes:
53 param_shapes = cls.param_shapes(sample_shape)
57 self.assertAllEqual(sample_shape,
60 self.assertAllEqual(sample_shape,
159 sample_shape = ops.convert_to_tensor([6, 7], dtype=dtypes.int32)
160 y = dist._set_sample_static_shape(x, sample_shape)
168 sample_shape = ops.convert_to_tensor([6, 7], dtype=dtypes.int32)
169 y = dist._set_sample_static_shape(x, sample_shape)
175 sample_shape = ops.convert_to_tensor([6, 7], dtype=dtypes.int32)
176 y = dist._set_sample_static_shape(x, sample_shape)
[all …]
Dhalf_normal_test.py57 def _testParamShapes(self, sample_shape, expected): argument
59 param_shapes = hn_lib.HalfNormal.param_shapes(sample_shape)
67 def _testParamStaticShapes(self, sample_shape, expected): argument
68 param_shapes = hn_lib.HalfNormal.param_static_shapes(sample_shape)
79 sample_shape = [10, 3, 4]
80 self._testParamShapes(sample_shape, sample_shape)
81 self._testParamShapes(constant_op.constant(sample_shape), sample_shape)
84 sample_shape = [10, 3, 4]
85 self._testParamStaticShapes(sample_shape, sample_shape)
87 tensor_shape.TensorShape(sample_shape), sample_shape)
Dcauchy_test.py58 def _testParamShapes(self, sample_shape, expected): argument
60 param_shapes = cauchy_lib.Cauchy.param_shapes(sample_shape)
70 def _testParamStaticShapes(self, sample_shape, expected): argument
71 param_shapes = cauchy_lib.Cauchy.param_static_shapes(sample_shape)
77 sample_shape = [10, 3, 4]
78 self._testParamShapes(sample_shape, sample_shape)
79 self._testParamShapes(constant_op.constant(sample_shape), sample_shape)
82 sample_shape = [10, 3, 4]
83 self._testParamStaticShapes(sample_shape, sample_shape)
85 tensor_shape.TensorShape(sample_shape), sample_shape)
Dshape_test.py49 def _random_sample(self, sample_shape, dtype=np.float32): argument
50 return self._rng.random_sample(sample_shape).astype(dtype)
57 sample_shape = x_shape[:n]
64 return y, sample_shape
69 y, sample_shape = shaper.make_batch_of_event_sample_matrices(
72 y, sample_shape, expand_batch_dim=expand_batch_dim)
73 return y, sample_shape, should_be_x_value
524 def _random_sample(self, sample_shape, dtype=dtypes.float64): argument
525 return self._rng.random_sample(sample_shape).astype(dtype.as_numpy_dtype())
/external/tensorflow/tensorflow/python/ops/distributions/
Ddistribution.py498 def param_shapes(cls, sample_shape, name="DistributionParamShapes"): argument
515 with ops.name_scope(name, values=[sample_shape]):
516 return cls._param_shapes(sample_shape)
519 def param_static_shapes(cls, sample_shape): argument
540 if isinstance(sample_shape, tensor_shape.TensorShape):
541 if not sample_shape.is_fully_defined():
543 sample_shape = sample_shape.as_list()
545 params = cls.param_shapes(sample_shape)
558 def _param_shapes(sample_shape): argument
739 def _call_sample_n(self, sample_shape, seed, name, **kwargs): argument
[all …]
Dtransformed_distribution.py385 sample_shape = _concat_vectors(
390 x = self.distribution.sample(sample_shape=sample_shape, seed=seed)
395 def _call_sample_n(self, sample_shape, seed, name, **kwargs): argument
399 with self._name_scope(name, values=[sample_shape]):
400 sample_shape = ops.convert_to_tensor(
401 sample_shape, dtype=dtypes.int32, name="sample_shape")
402 sample_shape, n = self._expand_sample_shape_to_vector(
403 sample_shape, "sample_shape")
413 final_shape = array_ops.concat([sample_shape, batch_event_shape], 0)
420 y = self._set_sample_static_shape(y, sample_shape)
/external/tensorflow/tensorflow/contrib/distributions/python/ops/
Dconditional_transformed_distribution.py56 sample_shape = _concat_vectors(
62 x = self.distribution.sample(sample_shape=sample_shape,
69 def _call_sample_n(self, sample_shape, seed, name, argument
75 with self._name_scope(name, values=[sample_shape]):
76 sample_shape = ops.convert_to_tensor(
77 sample_shape, dtype=dtypes.int32, name="sample_shape")
78 sample_shape, n = self._expand_sample_shape_to_vector(
79 sample_shape, "sample_shape")
89 final_shape = array_ops.concat([sample_shape, batch_event_shape], 0)
97 y = self._set_sample_static_shape(y, sample_shape)
Dshape.py400 sample_shape, batch_shape, event_shape = self.get_shape(x)
411 return x, sample_shape
416 self, x, sample_shape, expand_batch_dim=True, argument
437 with self._name_scope(name, values=[x, sample_shape]):
440 sample_shape = ops.convert_to_tensor(sample_shape, name="sample_shape")
464 new_shape = array_ops.concat([sample_shape, batch_shape, event_shape], 0)
Dbatch_reshape.py159 x = self.distribution.sample(sample_shape=n, seed=seed)
232 sample_shape = np.int32(static_sample_shape.as_list())
234 sample_shape = array_ops.shape(x)[:sample_ndims]
235 return sample_shape, static_sample_shape
241 sample_shape, static_sample_shape = self._sample_shape(x)
243 sample_shape,
250 sample_shape,
Dconditional_distribution.py35 def sample(self, sample_shape=(), seed=None, name="sample", argument
37 return self._call_sample_n(sample_shape, seed, name, **condition_kwargs)
Drelaxed_bernoulli.py197 def _param_shapes(sample_shape): argument
198 return {"logits": ops.convert_to_tensor(sample_shape, dtype=dtypes.int32)}
Dchi2.py115 def _param_shapes(sample_shape): argument
116 return {"df": ops.convert_to_tensor(sample_shape, dtype=dtypes.int32)}
/external/tensorflow/tensorflow/contrib/seq2seq/python/ops/
Dsampler.py341 sample_shape=self.batch_size,
438 sample_shape=self.batch_size,
637 sample_shape, argument
655 self.sample_shape = tensor_shape.TensorShape(sample_shape)
669 return self.sample_shape
697 def _call_sampler(sample_n_fn, sample_shape, name=None): argument
699 with ops.name_scope(name, "call_sampler", values=[sample_shape]):
700 sample_shape = ops.convert_to_tensor(
701 sample_shape, dtype=dtypes.int32, name="sample_shape")
704 math_ops.equal(array_ops.rank(sample_shape), 0), dtypes.int32)
[all …]
Dhelper.py57 def _call_sampler(sample_n_fn, sample_shape, name=None): argument
59 with ops.name_scope(name, "call_sampler", values=[sample_shape]):
60 sample_shape = ops.convert_to_tensor(
61 sample_shape, dtype=dtypes.int32, name="sample_shape")
63 pad = math_ops.cast(math_ops.equal(array_ops.rank(sample_shape), 0),
65 sample_shape = array_ops.reshape(
66 sample_shape,
67 array_ops.pad(array_ops.shape(sample_shape),
70 samples = sample_n_fn(math_ops.reduce_prod(sample_shape))
72 final_shape = array_ops.concat([sample_shape, batch_event_shape], 0)
[all …]
/external/tensorflow/tensorflow/contrib/distributions/python/ops/bijectors/
Daffine_linear_operator.py180 y, sample_shape = self._shaper.make_batch_of_event_sample_matrices(
186 y, sample_shape, expand_batch_dim=False)
196 x, sample_shape = self._shaper.make_batch_of_event_sample_matrices(
201 x, sample_shape, expand_batch_dim=False)
Daffine.py355 y, sample_shape = self._shaper.make_batch_of_event_sample_matrices(
361 y, sample_shape, expand_batch_dim=False)
373 x, sample_shape = self._shaper.make_batch_of_event_sample_matrices(
378 x, sample_shape, expand_batch_dim=False)
/external/tensorflow/tensorflow/python/kernel_tests/distributions/
Dnormal_test.py63 def _testParamShapes(self, sample_shape, expected): argument
64 param_shapes = normal_lib.Normal.param_shapes(sample_shape)
74 def _testParamStaticShapes(self, sample_shape, expected): argument
75 param_shapes = normal_lib.Normal.param_static_shapes(sample_shape)
90 sample_shape = [10, 3, 4]
91 self._testParamShapes(sample_shape, sample_shape)
92 self._testParamShapes(constant_op.constant(sample_shape), sample_shape)
96 sample_shape = [10, 3, 4]
97 self._testParamStaticShapes(sample_shape, sample_shape)
99 tensor_shape.TensorShape(sample_shape), sample_shape)
/external/tensorflow/tensorflow/tools/api/golden/v1/
Dtensorflow.distributions.-distribution.pbtxt104 …argspec: "args=[\'cls\', \'sample_shape\', \'name\'], varargs=None, keywords=None, defaults=[\'Dis…
108 argspec: "args=[\'cls\', \'sample_shape\'], varargs=None, keywords=None, defaults=None"
120 …argspec: "args=[\'self\', \'sample_shape\', \'seed\', \'name\'], varargs=None, keywords=None, defa…
Dtensorflow.distributions.-normal.pbtxt113 …argspec: "args=[\'cls\', \'sample_shape\', \'name\'], varargs=None, keywords=None, defaults=[\'Dis…
117 argspec: "args=[\'cls\', \'sample_shape\'], varargs=None, keywords=None, defaults=None"
129 …argspec: "args=[\'self\', \'sample_shape\', \'seed\', \'name\'], varargs=None, keywords=None, defa…
Dtensorflow.distributions.-categorical.pbtxt117 …argspec: "args=[\'cls\', \'sample_shape\', \'name\'], varargs=None, keywords=None, defaults=[\'Dis…
121 argspec: "args=[\'cls\', \'sample_shape\'], varargs=None, keywords=None, defaults=None"
133 …argspec: "args=[\'self\', \'sample_shape\', \'seed\', \'name\'], varargs=None, keywords=None, defa…
Dtensorflow.distributions.-uniform.pbtxt113 …argspec: "args=[\'cls\', \'sample_shape\', \'name\'], varargs=None, keywords=None, defaults=[\'Dis…
117 argspec: "args=[\'cls\', \'sample_shape\'], varargs=None, keywords=None, defaults=None"
133 …argspec: "args=[\'self\', \'sample_shape\', \'seed\', \'name\'], varargs=None, keywords=None, defa…
Dtensorflow.distributions.-exponential.pbtxt114 …argspec: "args=[\'cls\', \'sample_shape\', \'name\'], varargs=None, keywords=None, defaults=[\'Dis…
118 argspec: "args=[\'cls\', \'sample_shape\'], varargs=None, keywords=None, defaults=None"
130 …argspec: "args=[\'self\', \'sample_shape\', \'seed\', \'name\'], varargs=None, keywords=None, defa…
Dtensorflow.distributions.-dirichlet.pbtxt113 …argspec: "args=[\'cls\', \'sample_shape\', \'name\'], varargs=None, keywords=None, defaults=[\'Dis…
117 argspec: "args=[\'cls\', \'sample_shape\'], varargs=None, keywords=None, defaults=None"
129 …argspec: "args=[\'self\', \'sample_shape\', \'seed\', \'name\'], varargs=None, keywords=None, defa…
Dtensorflow.distributions.-student-t.pbtxt117 …argspec: "args=[\'cls\', \'sample_shape\', \'name\'], varargs=None, keywords=None, defaults=[\'Dis…
121 argspec: "args=[\'cls\', \'sample_shape\'], varargs=None, keywords=None, defaults=None"
133 …argspec: "args=[\'self\', \'sample_shape\', \'seed\', \'name\'], varargs=None, keywords=None, defa…

123