コード例 #1
0
ファイル: test_softplus.py プロジェクト: yrpang/mindspore
def test_init():
    """
    Test initializations.
    """
    b = msb.Softplus()
    assert isinstance(b, msb.Bijector)
    b = msb.Softplus(1.0)
    assert isinstance(b, msb.Bijector)
コード例 #2
0
ファイル: test_softplus.py プロジェクト: yrpang/mindspore
 def __init__(self):
     super(BackwardJacobian, self).__init__()
     self.b1 = msb.Softplus(2.0)
     self.b2 = msb.Softplus()
コード例 #3
0
ファイル: test_softplus.py プロジェクト: yrpang/mindspore
 def __init__(self):
     super(ForwardBackward, self).__init__()
     self.b1 = msb.Softplus(2.0)
     self.b2 = msb.Softplus()
コード例 #4
0
ファイル: test_softplus.py プロジェクト: yrpang/mindspore
def test_type():
    with pytest.raises(TypeError):
        msb.Softplus(sharpness='sharpness')
    with pytest.raises(TypeError):
        msb.Softplus(name=0.1)
コード例 #5
0
ファイル: test_softplus.py プロジェクト: yrpang/mindspore
 def __init__(self):
     super(Net, self).__init__()
     self.b1 = msb.Softplus(1.0)
     self.b2 = msb.Softplus()
コード例 #6
0
ファイル: test_softplus.py プロジェクト: zuoshou030/mindspore
 def __init__(self):
     super(Net3, self).__init__()
     self.bijector = msb.Softplus(sharpness=2.0)