Skip to content

Instantly share code, notes, and snippets.

@annanay25
Created July 3, 2017 18:49
Show Gist options
  • Select an option

  • Save annanay25/4d5126b63b39b0bf2dd5e424b29b87e9 to your computer and use it in GitHub Desktop.

Select an option

Save annanay25/4d5126b63b39b0bf2dd5e424b29b87e9 to your computer and use it in GitHub Desktop.
Pseudo code for Conv kernel.
Input = IMG: M x N X P KERNEL: X x Y x P <- Z such kernels.
for (a = Z)
for (i = M)
for (j = N)
for (k = X)
for (l = Y)
for (r = P)
sum += IMG[ i -X/2 + k , j - Y/2 + l , r ] * KERNEL [ k , l , r ]
ConvOutput[ i , j , a ] = sum
Output = ConvOutput Matrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment