python - Mxnet - 了解密集层的权重形状

标签 python deep-learning mxnet

我正在了解 Mxnet 框架。在关注此 Linear Regression article 时我看到以下代码正在创建一个密集层:

net = gluon.nn.Dense(1, in_units=2) # input dimension= 2, output dimension = 1

但为什么 print(net.weight) 将形状作为 Parameter dense4_weight (shape=(1, 2), dtype=None)

形状不应该是(2, 1)吗?

据我了解:

input = Shape(n, 2) where n is number of samples
output = Shape(n, 1)

所以矩阵乘法的权重矩阵应该是 Shape(2, 1),不是吗?

我在这里错过了什么?

最佳答案

这只是由于内部实现。您可以将其视为在乘法之前对权重矩阵进行转置。

关于python - Mxnet - 了解密集层的权重形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47477871/

相关文章:

python - TensorFlow 网络不训练?

python - MXNET : how to make prediction using a trained RNN model

python - 从 python3 检索 jinja2 模板变量

Python偏导数容易

python - 将补充参数传递给 hyperopt 目标函数

python - topk/sort 和 pick 的结果显然是矛盾的

python - MXNet 中的 CrossEntropy 和 NegativeLogLikelihood 有什么区别?

python - 为什么我不能正确使用 theano.tensor.argmax 和 theano.tensor.mean

deep-learning - 无法理解 TensorFlow 文档中的 shape(output) = (shape(value) - ksize + 1)/strides

python - 如何从 tensorflow 检查点文件正确恢复网络训练?