[mlpack-git] [mlpack/mlpack] fixes: convolve with correct weight slice, pad input in forward pass (#737)

Marcus Edel notifications at github.com
Sun Aug 14 12:29:42 EDT 2016


> +    for (size_t j = 0; j < input.n_rows; ++j)
> +    {
> +      input.slice(i).row(j) = a.subvec(vec_idx, vec_idx + 4).t();
> +      vec_idx += 5;
> +    }
> +  }
> +  ConvLayer<> conv3(4, 1, 3, 3, 1, 1, 1, 1);
> +  arma::mat id3 = arma::zeros<arma::mat>(3, 3);
> +  id3(1, 1) = 1;  
> +  arma::cube conv3_w(3, 3, 4 * 1);
> +  for (size_t i = 0; i < conv3_w.n_slices; ++i) 
> +    conv3_w.slice(i) = id3;
> +  conv3.Weights() = conv3_w;
> +  
> +  arma::cube output(5, 5, 1);
> +  output.slice(0) = input.slice(0) * 4;

Ah, right, thanks for the clarification.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/737/files/e8ef7f47ff7d398bd8a7a6982860294a5a468f68#r74704728
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160814/da0f7ae4/attachment.html>


More information about the mlpack-git mailing list