示例#1
0
     'desc_inputs': [[2592, 2048, 4, 4], [1, 2048, 3, 3]],
     'desc_bprop': [[2592, 2048, 4, 4]]}),
 ('SigmoidCrossEntropyWithLogits', {
     'block': P.SigmoidCrossEntropyWithLogits(),
     'desc_inputs': [[128, 10], [128, 10]],
     'desc_bprop': [[128, 10]]}),
 ('Pad', {
     'block': P.Pad(((1, 2), (2, 3))),
     'desc_inputs': [[7, 7]],
     'desc_bprop': [[10, 12]]}),
 ('BinaryCrossEntropy', {
     'block': P.BinaryCrossEntropy(),
     'desc_inputs': [[1, 2, 3], [1, 2, 3], [1, 2, 3]],
     'desc_bprop': []}),
 ('SparseApplyAdagrad', {
     'block': P.SparseApplyAdagrad(0.5),
     'desc_inputs': [[3, 3], [3, 3], [3, 3], Tensor(np.ones((3,), np.int32))],
     'desc_bprop': [3, 3],
     'skip': ['backward']}),
 ('Flatten_1', {
     'block': NetForFlatten(),
     'desc_inputs': [Tensor(np.ones([2, 3, 4]).astype(np.int32)), Tensor(np.ones([2, 12]).astype(np.int32))],
     'desc_bprop': [Tensor(np.ones([2, 12]).astype(np.int32))],
     'skip': ['backward']}),
 ('Flatten_2', {
     'block': NetForFlatten(),
     'desc_inputs': [Tensor(np.ones([8]).astype(np.int32)), Tensor(np.ones([8, 3]).astype(np.int32))],
     'desc_bprop': [Tensor(np.ones([8, 3]).astype(np.int32))],
     'skip': ['backward']}),
 ('ArgmaxNet', {
     'block': ArgmaxNet(),
示例#2
0
 def __init__(self, var, accum):
     super(SparseApplyAdagradNet, self).__init__()
     self.sparse_apply_adagrad = P.SparseApplyAdagrad(lr=0.01)
     self.var = Parameter(var, name="var")
     self.accum = Parameter(accum, name="accum")