FluxML/Flux.jl

Weights shape not validated against kernel, channels

已关闭

#2,506 创建于 2024年10月25日

 (5 条评论) (1 个反应) (0 位负责人)Julia (619 个派生)batch import
good first issuehelp wanted

仓库指标

星标
 (4,725 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

weights = Flux.kaiming_normal()(3, 3, 1)
Conv((3, 3), 1 => 1; pad = (1, 1), init = (_...) -> weights)
# Conv((3,), 3 => 1, pad=1)  # 10 parameters

weights = Flux.kaiming_normal()(3, 3, 1, 1)
Conv((3, 3), 1 => 1; pad = (1, 1), init = (_...) -> weights)
# Conv((3, 3), 1 => 1, pad=1)  # 10 parameters

I wanted to strictly specify the weight init for testing, but encountered this odd result. I think there should be validation to ensure that the weight shape matches the kernel size and input channels, and error if there is a mismatch.

贡献者指南