コード例 #1
0
def mean(y, x, axis=DEFAULT, dtype=DEFAULT, keepdims=DEFAULT):
    n = tangent.astype(tangent.array_size(x, axis), x)
    d[x] = tangent.astype(
        tangent.unreduce(d[y], numpy.shape(x), axis, keepdims), x) / n
コード例 #2
0
def sum(y, x, axis=DEFAULT, dtype=DEFAULT, keepdims=DEFAULT):
    d[x] = tangent.astype(
        tangent.unreduce(d[y], numpy.shape(x), axis, keepdims), x)
コード例 #3
0
ファイル: tangents.py プロジェクト: zhf459/tangent
def tunreduce(z, array, shape, axis, keepdims):
    d[z] = tangent.unreduce(d[array], d[shape], axis, keepdims)
コード例 #4
0
def mean(y, x, axis=None, dtype=None, keepdims=False):
    n = tangent.astype(tangent.array_size(x, axis), x)
    d[x] = tangent.astype(
        tangent.unreduce(d[y], numpy.shape(x), axis, keepdims), x) / n
コード例 #5
0
def sum(y, x, axis=None, dtype=None, keepdims=False):
    d[x] = tangent.astype(
        tangent.unreduce(d[y], numpy.shape(x), axis, keepdims), x)
コード例 #6
0
ファイル: grads.py プロジェクト: shihuaxing/tangent
def unbroadcast(y, array, shape):
    d[array] = tangent.unreduce(d[y], numpy.shape(array), None, False)