conv-neural-network

as_strided: Linking stepsize (strides of conv2d) with as_strided strides parameter

烈酒焚心 提交于 2019-12-24 08:59:10
问题 I found that for generating (X - x + 1, Y - y + 1) patches of size (x,y) from (X,Y) with stride 1, image requires us to give strides parameter as img.strides * 2 or img.strides + img.strides . I don't know how they quickly compute this knowing the no. of strides in conv2d But what should I do to get ((X-x)/stride)+1, ((Y-y)/stride)+1 patches of same size from same sized image with stride stride? From this SO answer with slight modification, with channels and number of images placed in front

D-lib object detector training

喜夏-厌秋 提交于 2019-12-24 08:33:39
问题 I am trying to train an object detector using D-lib. I selected close to 100 images for training. I am using the Python environment. As per documentation, I used the Imglab tool to draw the bounding boxes across the images. Every image is almost 4000*3000 pixels in size. And then placed the generated XML file into my location and called the detector program. Here are my doubts and questions. What should I use as the testing XML file while running the program? I ran without assigning any

Pytorch: Modifying VGG16 Architecture

安稳与你 提交于 2019-12-24 08:25:47
问题 I'm currently trying to modify the VGG16 network architecture so that it's able to accept 400x400 px images. Based on literature that I've read, the way to do it would be to covert the fully connected (FC) layers into convolutional (CONV) layers. This would essentially " allow the network to efficiently “slide” across a larger input image and make multiple evaluations of different parts of the image, incorporating all available contextual information." Afterwards, an Average Pooling layer is

how to get data from within Keras model for visualisation?

懵懂的女人 提交于 2019-12-24 07:34:07
问题 I am using Tensorflow 1.12 which has Keras integrated together with Python 3.6.x I wish to use Keras for its simplicity of model building, but also would like to use data on the intermediate layer for visualization of feature maps and kernels to better understand how machine learning works(even though this is admittedly not so evident) I am using the mnist data base and a very basic Keras model to try to do what I want to do. Here is the code import tensorflow as tf from tensorflow.keras

Keras: Feeding in part of previous layer to next layer, in CNN

六眼飞鱼酱① 提交于 2019-12-24 06:58:12
问题 I am trying to feed in the individual kernel outputs of the previous layer to a new conv filter, to get the next layer. To do that, I tried passing each of the kernel outputs through a Conv2D , by calling them by their index. The function I used is: def modification(weights_path=None, classes=2): ########### ## Input ## ########### ### 224x224x3 sized RGB Input inputs = Input(shape=(224,224,3)) ################################# ## Conv2D Layer with 5 kernels ## ###############################

Merge layers (concatenate) in keras

十年热恋 提交于 2019-12-24 06:38:48
问题 I am trying to implement this paper (the model architecture is given below) and have two models- coarse_model and fine_model which need to be concatenated at the second step of the fine model. However, I am getting an error when I trying to concatenate using the last axis. from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D from keras.layers import Activation, Dropout, Flatten, Dense, Merge from keras.layers.core import Reshape from keras.layers.merge import

Issues Training CNN with Prime number input dimensions

三世轮回 提交于 2019-12-24 06:07:51
问题 I am currently developing a CNN model with Keras (an autoencoder). This type my inputs are of shape (47,47,3) , that is a 47x47 image with 3 (RGB) layers. I have worked with some CNN's in the past, but this time my input dimensions are prime numbers (47 pixels). This I think is causing issues with my implementation, specifically when using MaxPooling2D and UpSampling2D in my model. I noticed that some dimensions are lost when max pooling and then up sampling . Using model.summary() I can see

Tensorflow neural network prediction is always the same

陌路散爱 提交于 2019-12-24 05:56:41
问题 I have a deep CNN that predicts a label between "0" and "2" for every pixel in a 3d image. I have trained the model on an image where every pixel is labeled "1". Therefore, when testing the model, I believe every prediction should be "1". Instead the model only predicts "0". Here is the repository for the whole model: https://github.com/dhasl002/Research-DeepLearning. Since the code is almost 300 lines, I will include only the relevant code below. x = tf.placeholder(tf.float32, shape=[None,

Keras: How to shape inputs for CNN and LSTM layers?

為{幸葍}努か 提交于 2019-12-24 03:39:10
问题 I am building a model to predict geospatial-temporal datasets. My data has original dimensions (features, lat, lon, time), i.e. for each feature and at each lat/lon point there is a time series. I have created a CNN-LSTM model using Keras like so (I assume the below needs to be modified, this is just a first attempt): def define_model_cnn_lstm(features, lats, lons, times): """ Create and return a model with CN and LSTM layers. Input and output data is expected to have shape (lats, lons, times

Keras: convolutional layer for 1D input

送分小仙女□ 提交于 2019-12-24 01:55:23
问题 I can not build CNN for 1D input vector. Example of input value: df_x.iloc[300] Out[33]: 0 0.571429 1 1.000000 2 0.971429 3 0.800000 4 1.000000 5 0.142857 6 0.657143 7 0.857143 8 0.971429 9 0.000000 10 0.000000 11 0.000000 12 0.000000 13 0.000000 14 0.000000 15 0.000000 Name: 300, dtype: float64 Example of output value: df_y.iloc[300] Out[34]: 0 0.571429 1 0.914286 2 1.000000 3 0.971429 4 0.800000 5 1.000000 6 0.914286 7 0.942857 8 0.800000 9 0.657143 10 0.857143 11 0.971429 12 0.000000 13 0