conv-neural-network

Loss suddenly increases with Adam Optimizer in Tensorflow

旧巷老猫 提交于 2019-12-21 03:44:50
问题 I am using a CNN for a regression task. I use Tensorflow and the optimizer is Adam. The network seems to converge perfectly fine till one point where the loss suddenly increases along with the validation error. Here are the loss plots of the labels and the weights separated (Optimizer is run on the sum of them) I use l2 loss for weight regularization and also for the labels. I apply some randomness on the training data. I am currently trying RSMProp to see if the behavior changes but it takes

TensorFlow ValueError: Variable does not exist, or was not created with tf.get_variable()

自作多情 提交于 2019-12-21 02:33:29
问题 I am a newbie to Tensorflow and trying to implement a Generative Adversarial Network. I am following this tutorial for the same in which we are trying to generate MNIST dataset like images using generative models. However, the code seems to be using older version of TensorFlow ( < 1.0 ), because of which it is giving out the following error: line: trainerD = tf.train.AdamOptimizer().minimize(d_loss, var_list=d_vars) ValueError: Variable d_wconv1/Adam/ does not exist, or was not created with

Why should we normalize data for deep learning in Keras?

北慕城南 提交于 2019-12-21 01:05:31
问题 I was testing some network architectures in Keras for classifying the MNIST dataset. I have implemented one that is similar to the LeNet. I have seem that in the examples that I have found in the internet, there is a step of data normalization. For example: X_train /= 255 I have performed a test without this normalization and I have seem that the performance (accuracy) of the network has decreased (keeping the same number of epochs). Why have this happened? If I increase the number of epochs,

caffe: What does the **group** param mean?

心已入冬 提交于 2019-12-20 10:47:16
问题 I have read the documentation about the group param: group (g) [default 1]: If g > 1, we restrict the connectivity of each filter to a subset of the input. Specifically, the input and output channels are separated into g groups, and the ith output group channels will be only connected to the ith input group channels. But first of all I do not understand exactly what they mean. And secondly, why would I use it. Could anyone help me to explain it a bit better? As far as I have understood it, it

How to have parallel convolutional layers in keras?

回眸只為那壹抹淺笑 提交于 2019-12-20 09:03:52
问题 I am a little new to neural networks and keras. I have some images with size 6*7 and the size of the filter is 15. I want to have several filters and train a convolutional layer separately on each and then combine them. I have looked at one example here: model = Sequential() model.add(Convolution2D(nb_filters, kernel_size[0], kernel_size[1], border_mode='valid', input_shape=input_shape)) model.add(Activation('relu')) model.add(Convolution2D(nb_filters, kernel_size[0], kernel_size[1])) model

Strange values of training and testing when running my CNN in Tensorflow

▼魔方 西西 提交于 2019-12-20 06:43:41
问题 I´ve been trying to train and evaluate a convolutional neural network using my own data, which consists in 200 training images and 20 testing images. My complete script is here: Error while running a convolutional network using my own data in Tensorflow When I run it, I don´t get any error and it seems to complete the whole process just fine, but the training values and testing result change randomly each time I run it, so I think that it´s not training anything at all. When I print the

How to build a multi-class convolutional neural network with Keras

十年热恋 提交于 2019-12-20 05:36:04
问题 I am trying to implement a U-Net with Keras with Tensorflow backend for an image segmentation task. I have images of size (128,96) as input to the network together with mask images of size (12288,6) since they are flattened. I have 6 different classes (0-5) which gives the second part of the mask images' shape. They have been encoded to one-hot labels using the to_categorical() function. At the moment I use just one input image and also use the same one as validation and test data. I would

A formula to find the size of a matrix after convolution

怎甘沉沦 提交于 2019-12-20 04:54:33
问题 If my input size is 5x5, the stride is 1x1, and the filter size is 3x3 then I can compute on paper that the final size of the convolved matrix will be 3x3. But, when this input size changes to 28x28, or 50x50 then how can I compute the size of the convolved matrix on paper? Is there any formula or any trick to do that? 回答1: Yes, there's a formula (see the details in cs231n class): W2 = (W1 - F + 2*P) / S + 1 H2 = (H1 - F + 2*P) / S + 1 where W1xH1 is the original image size, F is the filter

How to modify batch normalization layers (DeconvNet) to be able to run with caffe?

江枫思渺然 提交于 2019-12-20 04:52:13
问题 I wanted to run the Deconvnet on my data, however it seemd it has been written for another version of caffe . Does anyone know how to change batch_params ? The one that is in Deconvnet layers { bottom: 'conv1_1' top: 'conv1_1' name: 'bn1_1' type: BN bn_param { scale_filler { type: 'constant' value: 1 } shift_filler { type: 'constant' value: 0.001 } bn_mode: INFERENCE } } And the one that Caffe provides for cifar10 example: layer { name: "bn1" type: "BatchNorm" bottom: "pool1" top: "bn1" batch

Convolutional neural network outputting equal probabilities for all labels

给你一囗甜甜゛ 提交于 2019-12-20 04:24:14
问题 I am currently training a CNN on MNIST, and the output probabilities (softmax) are giving [0.1,0.1,...,0.1] as training goes on. The initial values aren't uniform, so I can't figure out if I'm doing something stupid here? I'm only training for 15 steps, just to see how training progresses; even though that's a low number, I don't think that should result in uniform predictions? import numpy as np import tensorflow as tf import imageio from sklearn.datasets import fetch_mldata mnist = fetch