We need them in this order: *(channel, height, width).*
On Wednesday, March 11, 2015 at 3:05:00 PM UTC+1, nouiz wrote: > > This is because when we load the image, the 3d tensor have the dimsions in > that order (width, height, channel) > > We need them in that order: (channel, width, height). > > Fred > > On Wed, Mar 11, 2015 at 5:18 AM, Orry Messer <[email protected] > <javascript:>> wrote: > >> Hi guys, >> >> I've recently started working with convnets and Theano. I'm busy going >> through the tutorial on deeplearning.net ( >> http://deeplearning.net/tutorial/lenet.html). >> >> I understand most of the 3wolfmoon example, but there's one point I just >> don't get --- Before the convolution is applied, the image is transposed >> and converted into a 4D tensor, as per the following line: >> >> img_ = img.transpose(2, 0, 1).reshape(1, 3, 639, 516) >> >> >> I understand that we need to convert the image into a 4D tensor in order >> to pass it into conv2d(), but why the transpose(2, 0, 1) operation? When I >> play around with the parameters, it completely messes up the resulting >> feature maps, but I haven't got a clue why :(. >> >> I feel like I'm missing something quite basic here. I'd be very grateful >> for a nudge in the right direction! >> >> Thanks, >> Orry >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "theano-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "theano-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
