Ejemplo n.º 1
0
def test_arguments():
    """
    args passing during initialization.
    """
    l = msd.Logistic()
    assert isinstance(l, msd.Distribution)
    l = msd.Logistic([3.0], [4.0], dtype=dtype.float32)
    assert isinstance(l, msd.Distribution)
Ejemplo n.º 2
0
 def __init__(self, shape, seed=0):
     super(Sampling, self).__init__()
     self.l = msd.Logistic(np.array([3.0]),
                           np.array([[2.0], [4.0]]),
                           seed=seed,
                           dtype=dtype.float32)
     self.shape = shape
Ejemplo n.º 3
0
 def __init__(self):
     super(Basics, self).__init__()
     self.l = msd.Logistic(np.array([3.0]),
                           np.array([2.0, 4.0]),
                           dtype=dtype.float32)
Ejemplo n.º 4
0
 def __init__(self):
     super(LogProb, self).__init__()
     self.l = msd.Logistic(np.array([3.0]),
                           np.array([[2.0], [4.0]]),
                           dtype=dtype.float32)
Ejemplo n.º 5
0
 def __init__(self):
     super(LogisticProb1, self).__init__()
     self.logistic = msd.Logistic()
Ejemplo n.º 6
0
 def __init__(self):
     super(LogisticProb, self).__init__()
     self.logistic = msd.Logistic(3.0, 4.0, dtype=dtype.float32)
Ejemplo n.º 7
0
def test_scale():
    with pytest.raises(ValueError):
        msd.Logistic(0., 0.)
    with pytest.raises(ValueError):
        msd.Logistic(0., -1.)
Ejemplo n.º 8
0
def test_name():
    with pytest.raises(TypeError):
        msd.Logistic(0., 1., name=1.0)
Ejemplo n.º 9
0
def test_seed():
    with pytest.raises(TypeError):
        msd.Logistic(0., 1., seed='seed')
Ejemplo n.º 10
0
def test_type():
    with pytest.raises(TypeError):
        msd.Logistic(0., 1., dtype=dtype.int32)
Ejemplo n.º 11
0
def test_logistic_shape_errpr():
    """
    Invalid shapes.
    """
    with pytest.raises(ValueError):
        msd.Logistic([[2.], [1.]], [[2.], [3.], [4.]], dtype=dtype.float32)
Ejemplo n.º 12
0
 def __init__(self):
     super(LogisticConstruct, self).__init__()
     self.logistic = msd.Logistic(3.0, 4.0)
     self.logistic1 = msd.Logistic()
Ejemplo n.º 13
0
 def __init__(self):
     super(Crossentropy, self).__init__()
     self.logistic = msd.Logistic(3.0, 4.0)
Ejemplo n.º 14
0
 def __init__(self):
     super(KL, self).__init__()
     self.logistic = msd.Logistic(3.0, 4.0)