何时在keras中使用Input shape vs batch_shape? [英] when do you use Input shape vs batch_shape in keras?

查看:424
本文介绍了何时在keras中使用Input shape vs batch_shape?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到解释keras输入的API.

I don't find API that explains keras Input.

何时应使用shape属性vs batch_shape属性?

When should you use shape attribute vs batch_shape attribute?

推荐答案

来自 Keras源代码:

参数

    shape: A shape tuple (integer), not including the batch size.
        For instance, `shape=(32,)` indicates that the expected input
        will be batches of 32-dimensional vectors.
    batch_shape: A shape tuple (integer), including the batch size.
        For instance, `batch_shape=(10, 32)` indicates that
        the expected input will be batches of 10 32-dimensional vectors.
        `batch_shape=(None, 32)` indicates batches of an arbitrary number
        of 32-dimensional vectors.

批量大小是您在训练数据中有多少个示例.

The batch size is how many examples you have in your training data.

您可以使用任何一个.我个人从未使用过"batch_shape".当您使用形状"时,您的批次可以是任意大小,您不必在意.

You can use any. Personally I never used "batch_shape". When you use "shape", your batch can be any size, you don't have to care about it.

shape=(32,)的含义与batch_shape=(None,32)

这篇关于何时在keras中使用Input shape vs batch_shape?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆