# Tag Info

## Hot answers tagged convolution

12

What are the filters? A filter/kernel is a set of learnable weights which are learned using the backpropagation algorithm. You can think of each filter as storing a single template/pattern. When you convolve this filter across the corresponding input, you are basically trying to find out the similarity between the stored template and different locations in ...

3

Odd numbers, usually, but not necessarily. This can depend on the problem at hand. The odd length of the side of the kernel is used in order to emphasize the center of the kernel. For a more detailed discussion of the geometry of kernels and convnets have a look at this thesis.

3

In a convolutional neural network (CNN), a convolutional layer has several channels, each of which has one convolution kernel, often written down as a matrix. This convolution kernel is nothing more than a collection of weights used to compute a linear combination of elements of the input. While both "traditional" dense layers and convolutional ...

2

The following will be the updated code for grayscale images: model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 1))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) ...

2

One choice is to train a neural network model to take these values and output original images. Notice that usually some data is loss in this process so it might be impossible to reconstruct the image with perfection. You could try inverting the functional form but: CNNs usually use ReLu activation which is not bijective. Pooling layers throws information ...

2

If I understood your question right, you want a mathematical expression for the I/O (input/output) relationship of a signal expander (name of the block that expands (upsamples) -without interpolation filering- an input signal $x[n]$) Below is a block diagram of signal expander by a factor of $L$:  x[n] \longrightarrow \boxed{ \uparrow L } \longrightarrow ...

2

Disclaimer: i am one of the authors of the referenced link. If you are doing pure image classification/segmentation, I would say no. I would not store the output of convolution layers, noramlly. In principle, the output of models can be stored in the feature store, however. Feature stores store data in tabular file formats (like parquet) and are used to ...

2

CNN learns the same way a Dense Neural network learns i.e. Forwardpass and Backpropagation. What we learn here are the weights of the filters. So, answers to your individual questions - But how are they getting initialized? - Standard init. e.g. glorot_uniform then the values should get changed on the training process of the network. Yes How does someone ...

2

The first formula you quote is for an image with one input channel and one output channel, it just focuses on height and width. In this case, if we consider a 5x5 convolution, the Kernel will just have size 5x5, $m$ and $n$ and going from -2 to +2. Now if our input has 3 channels (RGB, but could be feature maps). we need to use each channel as an input, and ...

1

No, you don't average across all feature maps. When the input has multiple channels, you need your convolution filter to have the same number of channels. Therefore, the filter "covers" the full depth of the input. Then, you simply perform the element-wise multiplication of the filter with the overlapping region in the input and add all the ...

1

I have solved the problem by changing the shape of my dataset using: tf.reshape(data, [25, 25])

1

Before answering your questions, let's understand a few points - 1. Model training is nothing but finding the right weights going through the guiding path based on the loss function o/p using y_true and y_pred. Training starts with random initialization of weights(definitely following some rules) 2. Neural Network training is an incremental training approach ...

1

As you quoted The padding argument effectively adds dilation * (kernel_size - 1) - padding, so you see the padding value is subtracted, the resulting shape becomes lower. It's a reverse (in some sense) operation to Conv2d, which means the arguments work the opposite way here. And I think this behavior is introduced to make it easier to design neural nets ...

1

I agree that these pictures are a bit confusing. I think they are all hinting at the following: As you know, CNNs involve splitting up the image into many small "blocks" and multiplying each block pairwise by a filter (actually, by several different filters). Weight sharing means that all the blocks use the same set of filters -- blocks in the ...

1

In some ways, convolutions do not introduce a radical departure from the standard architecture. Because the operations which are applied to the filtered input (max,min,mean,etc) are continuous, these filters amount to a lossy "layer" of the network. You are right to intuit that the filter parameters can be trained — so a filter which transforms a ...

1

I do not think there is a special kind of format that needs to be followed as long as the image is clear and readable, which (imho) it is for your case. Regarding the last 2/3 layers, the final layer is the output with 1 unit, so you pictured it correctly, along as the article mentions the output shape (that is not a multi-output situation). Good luck with ...

1

In absolute, it is one CNN wich takes 3 inputs images. You could see it as 3 separate features extractors (CNN) which merge their results while trained together. The author obtain 3 2D input from a 3D images by keeping 3 2D images; one in each plane. Each of these images has multiple channel because they slices the input among the respective axis. It is ...

1

The problem is that your ResNet-18 follows the architecture for ImageNet as outlined in the ResNet paper: However, spatial input dimensions of ImageNet are different from CIFAR10 (32x32) so the architecture does not match your input. Instead you can follow the author's description of their CIFAR10 architecture in section 4.2 of the same paper: The plain/...

1

Andrew Ng is making this point in comparison to a simple Neural network. Let's say you have a 10x10 image, In a dense neural network, - We will connect every 100 neurons to the 100 in the next layer.(Dense) - Over that, each all will have a distinct weight (No sharing) So, total parm = 10K In a Convolution Neural Network, the approach is as shown in this ...

1

In fact these involve different aspects of parameters in a CNN. Parameter sharing, means one parameter may be shared by more than one input/connection. So this reduces total amount of independent parameters. Parameters shared are non-zero. Sparsity of connections means that some parameters are simply missing (ie are zero), nothing to do with sharing same ...

1

The fourth dimension is because it is referring to either the full dataset(train/test) Or an individual batch. 600 - Number of images in the dataset or batch 64 x 64 - Size of each image 3 - Number of channels

1

600 can be the number of images of shape 64x64x3 and not only one image.

1

73 millions trainable parms - When using Transfer learning we first freeze the base model - Train it till you reach good accuracy - Then unfreeze it and train for just few epochs. Keep LR small Other probable issues - - If your labels are not One-Hot coded, please use sparse_categorical_crossentropy - Add validation_split in fit method - Suggest you add a ...

1

Based on the equation in the course: Weights 5 * 5 * 3 * 100 = 7500 Bias 100 So total would be 7600.

1

To get equivalent results : im_torch = im.reshape((1, 1, 3, 3)) filt_torch = filt.reshape((1, 1, 3, 3)) out = torch.nn.functional.conv2d(filt_torch, im_torch, stride=1, padding=0) print(out) import scipy.signal out_scipy = scipy.signal.convolve2d(im.detach().numpy(), filt.detach().numpy()[::-1, ::-1], 'valid') print(out_scipy) There was a shaping issue (...

1

If you have images of cats only, you could create boundary boxes (BB) of your images. Some BB will have cats an others won't. You will label those BB with cats inside as 1 as the others as 0. This way you can set up a dataset with a binary class. It will be much easier if you already have boundary boxes for the cats in each image since this way it will be ...

Only top voted, non community-wiki answers of a minimum length are eligible