conv-neural-network

How can I implement a checkerboard stride for Conv2d in pytorch?

。_饼干妹妹 提交于 2020-01-13 20:31:10
问题 I am trying to create a convnet using pytorch to work on an input of 2d matrices. I am using a 3x5 filter and I want it to have a custom stride as follows - on even line numbers I want the filter to start from the element at position 0 (red in the image), on odd line numbers I want it to start on the element of position 1 (blue in the image), and in both cases have a stride of 2 on the x direction. That means that if I have a matrix as in the image as my input, I want the filter to have only

Meaning of Weight Gradient in CNN

送分小仙女□ 提交于 2020-01-13 19:42:11
问题 I developed a CNN using MatConvNet and am able to visualize the weights of the 1st layer. It looked very similar to what is shown here (also attached below incase I am not specific enough) http://cs.stanford.edu/people/karpathy/convnetjs/demo/cifar10.html My question is, what are the weight gradients ? I'm not sure what those are and am unable to generate those... 回答1: Weights in a NN In a neural network, a series of linear functions represented as matrices are applied to features (usually

Meaning of Weight Gradient in CNN

旧街凉风 提交于 2020-01-13 19:42:09
问题 I developed a CNN using MatConvNet and am able to visualize the weights of the 1st layer. It looked very similar to what is shown here (also attached below incase I am not specific enough) http://cs.stanford.edu/people/karpathy/convnetjs/demo/cifar10.html My question is, what are the weight gradients ? I'm not sure what those are and am unable to generate those... 回答1: Weights in a NN In a neural network, a series of linear functions represented as matrices are applied to features (usually

Expected tensorflow model size from learned variables

。_饼干妹妹 提交于 2020-01-13 11:48:07
问题 When training convolutional neural networks for image classification tasks we generally want our algorithm to learn the filters (and biases) that transform a given image to its correct label. I have a few models I'm trying to compare in terms of model size, number of operations, accuracy, etc. However, the size of the model outputed from tensorflow, concretely the model.ckpt.data file that stores the values of all the variables in the graph, is not the one I expected. In fact, it seems to be

Performing Convolution (NOT cross-correlation) in pytorch

不羁的心 提交于 2020-01-12 18:43:30
问题 I have a network (https://github.com/TheAbhiKumar/tensorflow-value-iteration-networks) that I am trying to implement in pytorch (I'm very new to pytorch, however, not at all new to machine learning). In short, I cannot seem to figure out how to implement "pure" convolution in pytorch. In tensorflow it could be accomplished like this: def conv2d_flipkernel(x, k, name=None): return tf.nn.conv2d(x, flipkernel(k), name=name, strides=(1, 1, 1, 1), padding='SAME') With the flipkernel function being

Using Keras, how can I input an X_train of images (more than a thousand images)?

六眼飞鱼酱① 提交于 2020-01-12 02:37:52
问题 My application is accident-avoidance car systems using Machine Learning (Convolutional Neural Networks). My images are 200x100 JPG images and the output is an array of 4 elements: the car would move left, right, stop or move forward. So the output will let one element be 1 (according to the correct action that should be taken) and the 3 other elements will be 0 . I want to train my machine now in order to help it input any image and decide on the action independently. Here's my code: from

CNN with keras, accuracy not improving

不羁的心 提交于 2020-01-10 10:44:05
问题 I have started with Machine Learning recently, I am learning CNN, I planned to write an application for Car Damage severity detection, with the help of this Keras blog and this github repo. This is how car data-set looks like: F:\WORKSPACE\ML\CAR_DAMAGE_DETECTOR\DATASET\DATA3A ├───training (979 Images for all 3 categories of training set) │ ├───01-minor │ ├───02-moderate │ └───03-severe └───validation (171 Images for all 3 categories of validation set) ├───01-minor ├───02-moderate └───03

Deploy caffe regression model

≡放荡痞女 提交于 2020-01-10 05:26:13
问题 I have trained a regression network with caffe . I use "EuclideanLoss" layer in both the train and test phase. I have plotted these and the results look promising. Now I want to deploy the model and use it. I know that if SoftmaxLoss is used, the final layer must be Softmax in the deploy file. What should this be in the case of Euclidean loss ? 回答1: For deploy you only need to discard the loss layer, in your case the "EuclideanLoss" layer. The output of your net is the "bottom" you fed the

Val_accuracy (val_acc) very low [closed]

跟風遠走 提交于 2020-01-07 08:32:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 days ago . We have a data set that is converted from signal data to video. We want to classify these images using convolution. We tried many different methods but val acc is consistently low. Training accuracy is 99% and val_acc is 40%. We need your help in this respect. Thank you weight_decay=0.0005 input_ = Input(shape=

number of input channels does not match corresponding dimension of filter in Keras

谁说胖子不能爱 提交于 2020-01-07 05:40:15
问题 I am using keras to build a model based on the Resnet50, the following code is shown below input_crop = Input(shape=(3, 224, 224)) # extract feature from image crop resnet = ResNet50(include_top=False, weights='imagenet') for layer in resnet.layers: # set resnet as non-trainable layer.trainable = False crop_encoded = resnet(input_crop) However, I got an error 'ValueError: number of input channels does not match corresponding dimension of filter, 224 != 3' how can I fix it? 回答1: Such errors