Skip to content

Forward pass for the conv2d layer #65

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

Merged
merged 23 commits into from
May 16, 2022

Conversation

milancurcic
Copy link
Member

@milancurcic milancurcic commented May 10, 2022

This PR implements:

  • Forward pass for the conv2d layer
  • layer % get_output method for the conv2d and input3d layers
  • randn for 4-d data (used to initialize the convolution kernel)
  • A few tests for the input3d layer
  • Specific network % forward_3d method under the generic network % forward name

Some comments:

  • In the current forward pass implementation, the following dimension ordering seems to be most efficient regarding the memory layout, e.g. for the convolution kernel: filters x channels x width x height. This is consistent with the channels-last convention used by TensorFlow: In the input data, channels (e.g. red, green, blue) vary the fastest, then image width, then image height.
  • It looks like the convolution loop will provide some opportunity to parallelize (SPMD style)
  • associate appears buggy with ifort-2021.5; avoid it (the associate construct; not the compiler) for the time being, and revisit and file bug reports once we have a working implementation (i.e. when Add support for convolutional layers #64 is closed).

TODO

  • Make conv2d API consistent with the Keras API (i.e. conv2d(filters, kernel_size)).

Closes #60.

CC @katherbreen

@milancurcic milancurcic added the enhancement New feature or request label May 10, 2022
@milancurcic milancurcic requested a review from rouson May 10, 2022 18:15
@milancurcic milancurcic self-assigned this May 10, 2022
@milancurcic milancurcic merged commit d1b988a into modern-fortran:main May 16, 2022
@milancurcic milancurcic deleted the conv2d-forward-pass branch May 16, 2022 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

conv2d forward pass
1 participant