Пример #1
0
 def __init__(self, temp=0.1):
     super(LossNet, self).__init__()
     self.concat = P.Concat()
     self.exp = P.Exp()
     self.t = P.Transpose()
     self.diag_part = P.DiagPart()
     self.matmul = P.MatMul()
     self.sum = P.ReduceSum()
     self.sum_keep_dim = P.ReduceSum(keep_dims=True)
     self.log = P.Log()
     self.mean = P.ReduceMean()
     self.shape = P.Shape()
     self.eye = P.Eye()
     self.temp = temp
Пример #2
0
     'block': NetForUnpackInput(P.Unpack(axis=0)),
     'desc_inputs':[[2, 4]],
     'desc_bprop':[[4], [4]],
 }),
 ('Unpack_1', {
     'block': NetForUnpackInput(P.Unpack(axis=-1)),
     'desc_inputs':[Tensor(np.array([[1, 1, 1]], np.float32))],
     'desc_bprop':[[1], [1], [1]],
 }),
 ('Diag', {
     'block': P.Diag(),
     'desc_inputs': [[4]],
     'desc_bprop': [[4, 4]],
 }),
 ('DiagPart', {
     'block': P.DiagPart(),
     'desc_inputs': [[4, 4]],
     'desc_bprop': [[4]],
 }),
 ('SpaceToBatch_1', {
     'block': P.SpaceToBatch(2, [[0, 0], [0, 0]]),
     'desc_inputs': [[1, 3, 2, 2]],
     'desc_bprop': [[4, 3, 1, 1]],
 }),
 ('SpaceToBatch_2', {
     'block': P.SpaceToBatch(2, [[1, 1], [0, 4]]),
     'desc_inputs': [[1, 3, 2, 2]],
     'desc_bprop': [[4, 3, 2, 4]],
 }),
 ('BatchToSpace_1', {
     'block': P.BatchToSpace(2, [[0, 0], [0, 0]]),