Example #1
0
 def __init__(self, alpha=1.0):
     super(ELU, self).__init__()
     self.elu = P.Elu(alpha)
Example #2
0
     'desc_inputs': [[1, 3, 4, 4]],
     'desc_bprop': [[1, 3, 4, 4]]}),
 ('ReLU6', {
     'block': P.ReLU6(),
     'desc_inputs': [[1, 3, 4, 4]],
     'desc_bprop': [[1, 3, 4, 4]]}),
 ('ReLUV2', {
     'block': P.ReLUV2(),
     'desc_inputs': [[1, 3, 4, 4]],
     'desc_bprop': [[1, 3, 4, 4], [1, 3, 4, 4]]}),
 ('ReLUGrad', {
     'block': G.ReluGrad(),
     'desc_inputs': [[1, 3, 4, 4], [1, 3, 4, 4]],
     'skip': ['backward']}),
 ('Elu', {
     'block': P.Elu(),
     'desc_inputs': [[2, 3, 4]],
     'desc_bprop': [[2, 3, 4]]}),
 ('EluGrad', {
     'block': G.EluGrad(),
     'desc_inputs': [[2, 3, 4], [2, 3, 4]],
     'desc_bprop': [[2, 3, 4]],
     'skip': ['backward']}),
 ('Sigmoid', {
     'block': P.Sigmoid(),
     'desc_inputs': [[1, 3, 4, 4]],
     'desc_bprop': [[1, 3, 4, 4]]}),
 ('MaxPool', {
     'block': P.MaxPool(ksize=(2, 2), strides=(2, 2), padding="VALID"),
     'desc_inputs': [[100, 3, 28, 28]],
     'desc_bprop': [[100, 3, 14, 14]]}),
Example #3
0
 def __init__(self):
     super(NetElu, self).__init__()
     self.elu = P.Elu()
        'desc_inputs': [5.0],
        'skip': ['backward']
    }),
    # input is Tensor(int32)
    ('ReLU61', {
        'block': (P.ReLU6(), {
            'exception': TypeError,
            'error_keywords': ['ReLU6']
        }),
        'desc_inputs': [Tensor(np.ones([3, 4]).astype(np.int32))],
        'skip': ['backward']
    }),

    # input is scalar
    ('Elu0', {
        'block': (P.Elu(), {
            'exception': TypeError,
            'error_keywords': ['Elu']
        }),
        'desc_inputs': [5.0],
        'skip': ['backward']
    }),
    # input is Tensor(int32)
    ('Elu1', {
        'block': (P.Elu(), {
            'exception': TypeError,
            'error_keywords': ['Elu']
        }),
        'desc_inputs': [Tensor(np.ones([3, 4]).astype(np.int32))],
        'skip': ['backward']
    }),
Example #5
0
        'desc_inputs': [5.0],
        'skip': ['backward']
    }),
    # input is Tensor(int32)
    ('ReLU61', {
        'block': (P.ReLU6(), {
            'exception': TypeError,
            'error_keywords': ['ReLU6']
        }),
        'desc_inputs': [Tensor(np.ones([3, 4]).astype(np.int32))],
        'skip': ['backward']
    }),

    # input is scalar
    ('Elu0', {
        'block': (P.Elu(), {
            'exception': TypeError,
            'error_keywords': ['Elu']
        }),
        'desc_inputs': [5.0],
        'skip': ['backward']
    }),
    # input is Tensor(int32)
    ('Elu1', {
        'block': (P.Elu(alpha=0.9), {
            'exception': TypeError,
            'error_keywords': ['Elu']
        }),
        'desc_inputs': [Tensor(np.ones([3, 4]).astype(np.int32))],
        'skip': ['backward']
    }),