python - Keras - Conv1D 层 - 深度理解
问题描述
我正在尝试理解转换层
x = Conv1D(256, 3, padding='same', activation="relu")(x)
对于这一层,形状
input = (batch_size, 196, 512)
weight = (3, 512, 256)
bias = (256,)
output = (batch_size, 196, 256)
为了理解,我正在手动测试计算。
我正在创建两个形状为input
and的 numpy 数组weight
,
如果batch_size = 32
,
x = np.ones((32, 196, 512)) # Created an array with shape of input which is feed into the Conv1D layer(x)
weight = np.ones((3, 512, 256)) # Weight of the Conv1D layer(x)
y = np.dot(x, weight) # In every neural network, the y = input*weight+bias
输出的形状y
是(1, 196, 3, 256)
。但是,例外的形状是(32, 196, 256)
如何手动理解,谢谢
解决方案
推荐阅读
- c# - 需要将从 JSON 文件解析的 List 对象分配给对象属性
- azure - 在 Azure 上部署 Microsoft 企业机器人模板时出错
- javascript - 使用 Google 脚本的 MWS 发布请求
- java - 更改 askToContinue 方法,使其要求用户输入 Y、y、N 或 n
- android - 在 HashMap 中保存字节数组时出错
- android - Lint 警告:变量已分配给此值
- json.net - Newtonsoft.json.dll 给出错误:无法加载类型'System.Collections.Generic.IReadOnlyDictionary`2'
- mysql - 如何对mysql数据库进行哈希和加盐密码
- python - OperationalError: (1292, '截断不正确的 DOUBLE 值:\'1\'; UPDATE foo SET text = LOAD_FILE(\'/something/something.txt\');"-- \' ')
- ruby-on-rails - 如何修复未定义的方法“path_for”#
我正在设置一个帐户配置文件系统,我想在我的 rails 应用程序中支持一个带有 active_storage 的头像。我期待看到我的头像,但我得到了这个broken_pics