Skip to content
New issue

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

Possible invalid memory access? #37

Closed
cpennington opened this issue Aug 10, 2017 · 2 comments
Closed

Possible invalid memory access? #37

cpennington opened this issue Aug 10, 2017 · 2 comments

Comments

@cpennington
Copy link

I think the im2col (and maybe col2im) can potentially read uninitialized memory: Running Grenade.Layers.Internal.Convolution.im2col 10 10 2 2 $ (5><6) [0..] gives a bunch of small float values, which seem likely to be because of reading invalid memory locations.

@HuwCampbell
Copy link
Owner

im2col isn't a total function, it only works where the kernel and stride "fit" for the input the matrix. So yes, it does look like that's what's happening.

This "fitting" constraint is captured in the proofs going into the convolution and deconvolution layers. I found that if I tried to push these through to the im2col function it lead to a considerable slowdown, so put them in an internal function set instead.

It could probably be better documented, and maybe even just stop with error inside im2col if these constraints are violated.

@cpennington
Copy link
Author

Yeah, it seems like either erroring out in im2col when the arguments aren't valid would be a good safety net.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants