We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deep-learning-from-scratch/common/util.py
Lines 71 to 99 in 77eba24
上記コードでimgの初期化部分 img = np.zeros((N, C, H + 2*pad + stride - 1, W + 2*pad + stride - 1)) について、stride>1のときに余分なゼロ要素を生成している気がします。
img = np.zeros((N, C, H + 2*pad + stride - 1, W + 2*pad + stride - 1))
return時のスライスにて消去されるので結果には影響ないかと思いますが、 余分なメモリ使用やコード理解の妨げになるのではと思い投稿させていただきました。
改善案として、img初期化時の配列サイズは下記でよいかと思うのですがいかがでしょうか。 img = np.zeros((N, C, H + 2*pad, W + 2*pad))
img = np.zeros((N, C, H + 2*pad, W + 2*pad))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
deep-learning-from-scratch/common/util.py
Lines 71 to 99 in 77eba24
上記コードでimgの初期化部分
img = np.zeros((N, C, H + 2*pad + stride - 1, W + 2*pad + stride - 1))
について、stride>1のときに余分なゼロ要素を生成している気がします。
return時のスライスにて消去されるので結果には影響ないかと思いますが、
余分なメモリ使用やコード理解の妨げになるのではと思い投稿させていただきました。
改善案として、img初期化時の配列サイズは下記でよいかと思うのですがいかがでしょうか。
img = np.zeros((N, C, H + 2*pad, W + 2*pad))
The text was updated successfully, but these errors were encountered: