Finding gradient of a Caffe conv-filter with regards to input

I need to find the gradient with regards to the input layer for a single convolutional filter in a convolutional neural network (CNN) as a way to visualize the filters. Given a trained network in...

Neural network backpropagation with RELU

I am trying to implement neural network with RELU. input layer -> 1 hidden layer -> relu -> output layer -> softmax layer Above is the architecture of my neural network. I am confused about...

Why is the accuracy for my Keras model always 0 when training?

I'm pretty new to keras I have built a simple network to try: import numpy as np; from keras.models import Sequential; from keras.layers import Dense,Activation; data=...

Why batch normalization over channels only in CNN

I am wondering, if in Convolutional Neural Networks batch normalization should be applied with respect to every pixel separately, or should I take the mean of pixels with respect to each...

Weighing Training Data for Keras

Problem I want to train a keras2 neural network (theano backend) with data of variable relevance. That means some of the samples are less important than others. They shall affect the training less...

Google Colab is very slow compared to my PC

I've recently started to use Google Colab, and wanted to train my first Convolutional NN. I imported the images from my Google Drive thanks to the answer I got here. Then I pasted my code to...

How can I update the parameters of a neural network in PyTorch?

Let's say I wanted to multiply all parameters of a neural network in PyTorch (an instance of a class inheriting from torch.nn.Module) by 0.9. How would I do that?

PyTorch element-wise filter layer

Hi, I want to add element-wise multiplication layer to duplicate the input to multi-channels like this figure. (So, the input size M x N and multiplication filter size M x N is same), as...

Is there an optimizer in keras based on precision or recall instead of loss?

I am developping a segmentation neural network with only two classes, 0 and 1 (0 is the background and 1 the object that I want to find on the image). On each image, there are about 80% of 1 and...

How do I find the false positive and false negative rates for a neural network?

I have the below code which works perfectly for a neural network. I know I need the confusion matrix library to find the false positive and false negative rates but I'm not sure how to do it as...

Drop inactive features in Keras

I'm building a Sequential NN model in Keras for binary classification. The training data has about 600,000 rows and 2,000 features, so every epoch and every layer is very time consuming. I believe...

RuntimeError: Given groups=1, weight of size 16 1 5 5, expected input[100, 3, 256, 256] to have 1 channels, but got 3 channels instead

I try to run the following programe for images classification problem in Pytorch: import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms import...

custom loss function in Keras combining multiple outputs

I did a lot of searching and am still unable to figure out writing a custom loss function with multiple outputs where they interact. I have a Neural Network defined as : def NeuralNetwork(): ...

OSError: SavedModel file does not exist at: ../dnn/mpg_model.h5/{saved_model.pbtxt|saved_model.pb}

** code editor: vscode cmd: anaconda prompt I followed the tutorial but why this error? ** first error was ModuleNotFoundError: No module named 'tensorflow' but i make env and install it second...

How to put image uploaded in tkinter into a function?

I am trying to create a Python tkinter application where the user can upload an image from file and the image is put through a image segmentation function which outputs an matplotlib plot. I have...

CNN with multiple output types

I am a newcomer to convolutional neural networks and have the following question: Is there a way to create a CNN with multiple outputs, including 10 for classification and two more for regression...

Back propagation from decoder input to encoder output in variational autoencoder

I am trying to understand VAE in-depth by implementing it by myself and having difficulties when back-propagate losses of the decoder input layer to the encoder output layer. My encoder network...

RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target'

I'm running into an issue while calculating the loss for my Neural Net. I'm not sure why the program expects a long object because all my Tensors are in float form. I looked at threads with...

Tensorflow for XOR is not predicting correctly after 500 epochs

I'm trying to implement a Neural Network to solve the XOR problem using TensorFlow. I chose sigmoid as activation function, shape (2, 2, 1) and optimizer=SGD(). I choose batch_size=1 because the...

Fine-tune Bert for specific domain (unsupervised)

I want to fine-tune BERT on texts that are related to a specific domain (in my case related to engineering). The training should be unsupervised since I don't have any labels or anything. Is this possible?

Scene Text Image Super-Resolution for OCR

I am working on an OCR system. A challenge that I'm facing for recognizing the text within ROI is due to the shakiness or motion effect shot or text that is not focus due to angle positions....

What does this tensorflow message mean? Any side effect? Was the installation successful?

I just installed tensorflow v2.3 on anaconda python. I tried to test out the installation using the python command below; $ python -c "import tensorflow as tf; x = [[2.]]; print('tensorflow...

EXC_BAD_ACCESS on VNSequenceRequestHandler

The following code uses the Vision and AVFoundation frameworks to enable face tracking on the built-in camera on macOS. In some circumstances the code crashes due to EXC_BAD_ACCESS (code=2) on a...

If I Trace a PyTorch Network on Cuda, can I use it on CPU?

I traced my Neural Network using torch.jit.trace on a CUDA-compatible GPU server. When I reloaded that Trace on the same server, I could reload it and use it fine. Now, when I downloaded it onto...

GPU underutilized in Actor Critic (A2C) Stable Baselines3 implementation

I am trying to use A2C of StablesBaselines3 for training an agent on my custom environment. My problem is that my GPU Utilization is very less (around 10 % only) while my CPU utilization has hit...

Dependent hyperparameters with keras tuner

My goal is to tune over possible network architectures that meet the following criteria: Layer 1 can have any number of hidden units from this list: [32, 64, 128, 256, 512] Then, the number of...

Is there a way to show activation function in model plots tensorflow ( tf.keras.utils.plot_model() )?

The model plot in TensorFlow shows the shape of input, dtype and layer name. Is there some way to show the type of activation function as well? If there is some other better way of...

How to fine tune a pre-trained GAN?

I would like to fine tune a pre-trained GAN available online using my own images. For example, BigGAN, which was trained on ImageNet, can generate realistic images. However, I do not want to...

Could not load library cudnn_cnn_infer64_8.dll. Error code 126

Could not load library cudnn_cnn_infer64_8.dll. Error code 126 Please make sure cudnn_cnn_infer64_8.dll is in your library path! I keep getting this error when I try to use TensorFlow with GPU,...

How to plot learning curves for each trial using the keras-tuner

I am using keras tuner for model selection for my neural network model for a regression task, I would like to plot the learning curves for loss and validation loss for each iteration of the random...