Tag Info

New answers tagged convolutional-neural-network

0

I believe this could help someone. The problem was that the output classes were randomly assigned. My classes are called: 0,1,2,3,4...,22. However, DataGenerator assigned output '5' to class 13, output '7' to class 15, and so on. Hence, the classes were shuffled. It is important to assign the output to each class.

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

You need to first define the model. Once you have defined the model, then, instantiate a class of it. Once that is done, use model.load_state_dict(torch.load(path_to_model_file)).

1

Got the very same error recently. Your network is usually defined as a class (here class EfficientNet(nn.Module). It seems when we load a model, it needs the class to be defined so it can instantiate it. In my case, the class was defined in the training .py file. So what I did to fix that error was just copy-paste (it seems importing it didn't work for me, ...

2

The loop for the validation data would look very similar to your training loop, but for your validation data you only have to calculate the loss and not backpropagate the error. It would look something like this: def train(net): BATCH_SIZE = 64 EPOCHS = 10 for epoch in range(EPOCHS): # training loop model.train(...

0

I figured it out. You have to convert tests labels in single-digits instead of one-hot encoding. To achieve this I changed the confusion matrix code from: Y_pred = np.argmax(model.predict(X_test),axis=1) print('Confusion Matrix') print(multilabel_confusion_matrix(y_test, Y_pred)) print('Classification Report') To: y_test_arg=np.argmax(y_test,axis=1) Y_pred =...

1

To be clear, do you think the data could be distributed according to a particular probability distribution? If so you should model it directly without a neural network. Your model parameters are simply the parameters of that probability distribution ($\mu$ and $\sigma^2$ for a gaussian, $\lambda$ for a poisson etc.,). If you think your data is distributed ...

0

That could a lot of reasons for that. For example, images are sometimes represented with numbers in range 0-1 and sometimes in range 0-255 and it's very easy to mix these ranges for in-dataset / external as the model would fail silently without any warnings. In general, if the same model gives you different results, then images are not exactly the same. I ...

0

Yes, it can depend on it because it changes the data distribution with the network is trained. You shouldn't consider random seed as a hyperparameter. Keep the same random seed and run comparison. Do this for at least 5 or 10 random seeds. You will definitely have a winner. If you don't go for more than 10 unless you get a winner. That will give you ...

2

No, your understanding is not correct. Each of the 64 filters of the second layer will be applied to each of the 32 channels from the output of the first layer, resulting in 64 channels in the output of the second layer. When the input of a convolutional layer has multiple channels, the convolution filter itself has the same number of channels. In your ...

1

Transpose in mathematics means to change the order of matrix in an opposite way, the same notion carries here but not the exact sense, you are talking about. The same problem exists with the word 'convolution', it means something else in mathematics. What is done in deep learning in name of convolution is cross-correlation in mathematics.

0

Rather than directly using the dataset to train the model, mutate the data in the ratio of 4:1 or as you think will remove the skewness in the original dataset. Then use it to train the model you'll get better results.

0

With Keras, you could use the functional API, to estimate a model with two outputs („multioutput“). Simply train the model on two outputs like: # Outputs out1 = Dense(1)(x) out2 = Dense(1)(x) # Compile/fit the model model = Model(inputs=Input_1, outputs=[out1,out2]) model.compile(optimizer = "rmsprop", loss = 'mse') # Add actual data here in the ...

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 ...

Top 50 recent answers are included