Ejemplo n.º 1
0
    def default_q(self):
        if "A" in self.inputs_random:
            q_A = self.inputs_random["A"].q_distribution()
        else:
            q_A = self.inputs_nonrandom["A"]

        std = positive_exp(shape=self.shape)
        return NoisyCumulativeSum(A=q_A,
                                  std=std,
                                  shape=self.shape,
                                  name="q_" + self.name)
Ejemplo n.º 2
0
    def default_q(self):
        if "weights" in self.inputs_random:
            q_weights = self.inputs_random["weights"].q_distribution()
        else:
            q_weights = self.inputs_nonrandom["weights"]

        if "centers" in self.inputs_random:
            q_centers = self.inputs_random["centers"].q_distribution()
        else:
            q_centers = self.inputs_nonrandom["centers"]

        std = positive_exp(shape=self.shape)
        return GMMClustering(weights=q_weights,
                             centers=q_centers,
                             std=std,
                             shape=self.shape,
                             name="q_" + self.name)
Ejemplo n.º 3
0
    def default_q(self):
        if "A" in self.inputs_random:
            q_A = self.inputs_random["A"].q_distribution()
        else:
            q_A = self.inputs_nonrandom["A"]

        if "B" in self.inputs_random:
            q_B = self.inputs_random["B"].q_distribution()
        else:
            q_B = self.inputs_nonrandom["B"]

        std = positive_exp(shape=self.shape)
        return NoisyGaussianMatrixProduct(A=q_A,
                                          B=q_B,
                                          std=std,
                                          rescale=self.rescale,
                                          shape=self.shape,
                                          name="q_" + self.name)
Ejemplo n.º 4
0
    def inputs(self):
        pe = lambda shape=None, name=None: positive_exp(
            shape=shape, name=name, init_log=np.float32(np.ones(shape) * -2.))

        return {"mean": unconstrained, "std": pe}