convolution

Replicating TensorFlows Conv2D Operating using Eigen Tensors

杀马特。学长 韩版系。学妹 提交于 2019-12-08 01:54:22
问题 I'm trying to implement a lightweight (minimal library dependencies) version of a TensorFlow graph in c++ and I'm trying to use Eigen Tensor objects to perform the graphs operations. Right now I'm stuck trying to use the Eigen Tensor.convolve() method to try and replicate the behaviour of TensorFlow's Conv2D operation. To keep things simple my initial Conv2D operation has no padding and strides of one. The input to convolutional layer is a 51x51x1 tensor which is being convolved with a filter

Multiple convolutions in Matlab

 ̄綄美尐妖づ 提交于 2019-12-08 00:44:45
问题 I want to numerically calculate several convolutions like where the x , y , z , w functions are given in the below code: t = linspace(-100,100,10000); x = t.*exp(-t.^2); y = exp(-4*t.^2).*cos(t); z = (t-2)/((t-2).^2+3^2); w = exp(-3*t.^2).*exp(2i*t); u = conv(conv(conv(x,y),z),w); plot(t,u) % ??? - if we want to convolute N functions, what range should t span? Is this the most efficient way to calculate and plot multiple convolutions? Is it generally better to numerically integrate the

tensorflow conv2d memory consumption explain?

蓝咒 提交于 2019-12-07 20:33:29
output = tf.nn.conv2d(input, weights, strides = [1,3,3,1], padding = 'VALID') My input has shape 200x225x225x1, weights is 15x15x1x64. Hence, the output has shape 200x71x71x64 since (225-15)/3 + 1 = 71 Tensorboard shows that this operation consumes totally 768MB (see pic below). Assuming it takes into account the size of input (38.6MB), weights (0.06MB) and output (246.2MB) the total memory consumption should not exceed 300MB. So where does the rest of the memory consumption come from? Although I'm not able to reproduce your graph and values based on information provided, it's possible that

Convolution of multiple 1D signals in a 2D matrix with multiple 1D kernels in a 2D matrix

♀尐吖头ヾ 提交于 2019-12-07 20:26:52
问题 I have a randomly defined H matrix of size 600 x 10 . Each element in this matrix H can be represented as H(k,t) . I obtained a speech spectrogram S which is 600 x 597 . I obtained it using Mel features, so it should be 40 x 611 but then I used a frame stacking concept in which I stacked 15 frames together. Therefore it gave me (40x15) x (611-15+1) which is 600 x 597 . Now I want to obtain an output matrix Y which is given by the equation based on convolution Y(k,t) = ∑ H(k,τ)S(k,t-τ) . The

Complex convolution in tensorflow

青春壹個敷衍的年華 提交于 2019-12-07 15:41:11
问题 I'm trying to run a simple convolution but with complex numbers: r = np.random.random([1,10,10,10]) i = np.random.random([1,10,10,10]) x = tf.complex(r,i) conv_layer = tf.layers.conv2d( inputs=x, filters=10, kernel_size=[3,3], kernel_initializer=utils.truncated_normal_complex(), activation=tf.nn.sigmoid) However I get this error: TypeError: Value passed to parameter 'input' has DataType complex128 not in list of allowed values: float16, float32 Does anyone know how to implement such a

Python/Tensorflow - I have trained the convolutional neural network, how to test it?

 ̄綄美尐妖づ 提交于 2019-12-07 14:32:19
问题 I have trained a convolutional neural network (CNN) with the following data that I had in a binary file (label, filename, data (pixels)): [array([2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0]), array(['10_c.jpg', '10_m.jpg', '10_n.jpg', '1_c.jpg', '1_m.jpg', '1_n.jpg', '2_c.jpg', '2_m.jpg', '2_n.jpg', '3_c.jpg', '3_m.jpg', '3_n.jpg', '4_c.jpg', '4_m.jpg', '4_n.jpg', '5_c.jpg', '5_m.jpg', '5_n.jpg', '6_c.jpg', '6_m.jpg', '6_n.jpg', '7_c.jpg', '7_m

Convolutional Neural Networks: How many pixels will be covered by each of the filters?

半腔热情 提交于 2019-12-07 08:40:49
问题 How can I calculate the area (in the original image) covered by each of the filters in my network? e.g. Lets say the size of the image is WxW pixels. I am using the following network: layer 1 : conv : 5x5 layer 2 : pool : 3x3 layer 3 : conv : 5x5 ..... layer N : conv : 5x5 I want to calculate how much area in the original image will be covered by each filter. e.g. the filter in the layer 1 will cover 5x5 pixels in the original image. 回答1: A similar problem would be, how many pixels will be

How can I implement deconvolution layer for a CNN in numpy?

拟墨画扇 提交于 2019-12-07 07:07:14
问题 I try to implement Deconvolution layer for a Convolution Network. What I mean by deconvolution is that suppose I have 3x227x227 input image to a layer with filters in size 3x11x11 and stride 4. Hence the resulting feature map has size 55x55 . What I try to do is to apply the reverse operation where I project 55x55 feature map to again 3x227x227 image. Basically each value on 55x55 feature map is weighted by 3x11x11 filters and projected to image space and overlapping regions due to stride is

Image convolution with even-sized kernel

一笑奈何 提交于 2019-12-06 23:47:25
问题 I want to perform a simple 2D image convolution but my kernel is even-sized. Which indices I should pick for my kernel center? I tried googling for an answer and looking existing codes. People usually center their kernel so there would be one sample more before the new 0. So, if we have a 4x4 kernel the centered indices should be -2 -1 0 +1 . Is that correct? And if it is, why is that so? Can someone explain why -2 -1 0 +1 is correct while -1 0 +1 +2 is not? Keep in mind that I want to

The different with the image convolve with the conv2D of keras

社会主义新天地 提交于 2019-12-06 14:28:20
问题 The goal is trying to using a customize weight on the first layer of model to full fill the function of highpass filter---make the first layer of Model is the same as the high pass filter to the image. 1.first, the similar solution will be: using a high pass filter in the image processing, and generate a new image, and use it in the model. ---this is have to use the image processing, which is cost of time. 2.I want to set the a layer of Conv2D , which is also able to high pass the image. with