Esempio n. 1
0
 def make_simple_gluon_model(self):
     net = self.make_net()
     m = Model()
     m.x = Variable(shape=(1, 1))
     m.f = MXFusionGluonFunction(net, num_outputs=1)
     m.y = m.f(m.x)
     return m
Esempio n. 2
0
    def test_gluon_parameters(self):
        self.setUp()

        m = Model()
        m.x = Variable(shape=(1, 1))
        m.f = MXFusionGluonFunction(self.net, num_outputs=1)
        m.y = m.f(m.x)

        infr = Inference(ForwardSamplingAlgorithm(m, observed=[m.x]))
        infr.run(x=mx.nd.ones((1, 1)))
        assert all([
            v.uuid in infr.params.param_dict for v in m.f.parameters.values()
        ])