Exemple #1
0
def test_init():
    """
    Test initializations.
    """
    b = msb.Softplus()
    assert isinstance(b, msb.Bijector)
    b = msb.Softplus(1.0)
    assert isinstance(b, msb.Bijector)
Exemple #2
0
 def __init__(self):
     super(BackwardJacobian, self).__init__()
     self.b1 = msb.Softplus(2.0)
     self.b2 = msb.Softplus()
Exemple #3
0
 def __init__(self):
     super(ForwardBackward, self).__init__()
     self.b1 = msb.Softplus(2.0)
     self.b2 = msb.Softplus()
Exemple #4
0
def test_type():
    with pytest.raises(TypeError):
        msb.Softplus(sharpness='sharpness')
    with pytest.raises(TypeError):
        msb.Softplus(name=0.1)
Exemple #5
0
 def __init__(self):
     super(Net, self).__init__()
     self.b1 = msb.Softplus(1.0)
     self.b2 = msb.Softplus()
 def __init__(self):
     super(Net3, self).__init__()
     self.bijector = msb.Softplus(sharpness=2.0)