Home | History | Annotate | Download | only in ops

Lines Matching defs:components

56     components=[
71 components,
81 properties (the components).
84 time and match `len(components)`.
89 components: A list or tuple of `Distribution` instances.
108 TypeError: If cat is not a `Categorical`, or `components` is not
109 a list or tuple, or the elements of `components` are not
111 ValueError: If `components` is an empty list or tuple, or its
115 `len(components)`, or all `components` and `cat` do not have
116 matching static batch shapes, or all components do not
123 if not components:
124 raise ValueError("components must be a non-empty list or tuple")
125 if not isinstance(components, (list, tuple)):
126 raise TypeError("components must be a list or tuple, but saw: %s" %
127 components)
128 if not all(isinstance(c, distribution.Distribution) for c in components):
130 "all entries in components must be Distribution instances"
131 " but saw: %s" % components)
133 dtype = components[0].dtype
134 if not all(d.dtype == dtype for d in components):
135 raise TypeError("All components must have the same dtype, but saw "
136 "dtypes: %s" % [(d.name, d.dtype) for d in components])
137 static_event_shape = components[0].event_shape
139 for d in components:
144 "Expected to know rank(event_shape) from components, but "
145 "none of the components provide a static number of ndims")
154 "to compare this value to the number of components passed in.")
157 if static_num_components != len(components):
158 raise ValueError("cat.num_classes != len(components): %d vs. %d" %
159 (static_num_components, len(components)))
164 batch_shapes = [d.batch_shape_tensor() for d in components]
166 check_message = ("components[%d] batch shape must match cat "
171 for di in range(len(components))
176 for di in range(len(components))
182 self._components = list(components)
211 def components(self):
247 distribution_means = [d.mean() for d in self.components]
259 distribution_means = [d.mean() for d in self.components]
260 distribution_devs = [d.stddev() for d in self.components]
270 array_ops.reshape(broadcasted_cat_probs, [-1, len(self.components)]),
271 array_ops.reshape(stacked_means, [-1, len(self.components)]),
272 array_ops.reshape(stacked_devs, [-1, len(self.components)]))
281 distribution_log_probs = [d.log_prob(x) for d in self.components]
294 distribution_log_cdfs = [d.log_cdf(x) for d in self.components]
314 samples.append(self.components[c].sample(n, seed=seed))
398 samples_class_c = self.components[c].sample(n_class, seed=seed)
426 # Stitch back together the samples across the components.
442 on the mixture probabilities and the components in use.
479 distribution_entropies = [d.entropy() for d in self.components]