gpt4 book ai didi

python - Keras 后端函数中的参数 keepdims 是做什么用的?

转载 作者:太空狗 更新时间:2023-10-30 02:42:07 26 4
gpt4 key购买 nike

Keras 后端有很多函数都带有 keepdims 参数。比如

sum(x, axis=None, keepdims=False)

我找不到任何关于这意味着什么的解释。有人可以解释它的作用吗?

此外,axisNone 是什么意思?这和说 axis = -1 一样吗?

最佳答案

这些不是 keras 特定参数,而是 numpy.sum 参数。

axis : None or int or tuple of ints, optional

Axis or axes along which a sum is performed. The default (axis = None) is perform a sum over all the dimensions of the input array. axis may be negative, in which case it counts from the last to the first axis.

New in version 1.7.0.

If this is a tuple of ints, a sum is performed on multiple axes, instead of a single axis or all the axes as before.

keepdims : bool, optional

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the original arr.

here is the source

关于python - Keras 后端函数中的参数 keepdims 是做什么用的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37624813/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com