Beispiel #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)
 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
 def __init__(self):
     super(Basics, self).__init__()
     self.l = msd.Logistic(np.array([3.0]),
                           np.array([2.0, 4.0]),
                           dtype=dtype.float32)
 def __init__(self):
     super(LogProb, self).__init__()
     self.l = msd.Logistic(np.array([3.0]),
                           np.array([[2.0], [4.0]]),
                           dtype=dtype.float32)
Beispiel #5
0
 def __init__(self):
     super(LogisticProb1, self).__init__()
     self.logistic = msd.Logistic()
Beispiel #6
0
 def __init__(self):
     super(LogisticProb, self).__init__()
     self.logistic = msd.Logistic(3.0, 4.0, dtype=dtype.float32)
Beispiel #7
0
def test_scale():
    with pytest.raises(ValueError):
        msd.Logistic(0., 0.)
    with pytest.raises(ValueError):
        msd.Logistic(0., -1.)
Beispiel #8
0
def test_name():
    with pytest.raises(TypeError):
        msd.Logistic(0., 1., name=1.0)
Beispiel #9
0
def test_seed():
    with pytest.raises(TypeError):
        msd.Logistic(0., 1., seed='seed')
Beispiel #10
0
def test_type():
    with pytest.raises(TypeError):
        msd.Logistic(0., 1., dtype=dtype.int32)
Beispiel #11
0
def test_logistic_shape_errpr():
    """
    Invalid shapes.
    """
    with pytest.raises(ValueError):
        msd.Logistic([[2.], [1.]], [[2.], [3.], [4.]], dtype=dtype.float32)
Beispiel #12
0
 def __init__(self):
     super(LogisticConstruct, self).__init__()
     self.logistic = msd.Logistic(3.0, 4.0)
     self.logistic1 = msd.Logistic()
Beispiel #13
0
 def __init__(self):
     super(Crossentropy, self).__init__()
     self.logistic = msd.Logistic(3.0, 4.0)
Beispiel #14
0
 def __init__(self):
     super(KL, self).__init__()
     self.logistic = msd.Logistic(3.0, 4.0)