conv-neural-network

Batch normalization layer for CNN-LSTM

只谈情不闲聊 提交于 2020-01-22 16:11:09
问题 Suppose that I have a model like this (this is a model for time series forecasting): ipt = Input((data.shape[1] ,data.shape[2])) # 1 x = Conv1D(filters = 10, kernel_size = 3, padding = 'causal', activation = 'relu')(ipt) # 2 x = LSTM(15, return_sequences = False)(x) # 3 x = BatchNormalization()(x) # 4 out = Dense(1, activation = 'relu')(x) # 5 Now I want to add batch normalization layer to this network. Considering the fact that batch normalization doesn't work with LSTM, Can I add it before

Fully Convolutional Network Receptive Field

﹥>﹥吖頭↗ 提交于 2020-01-21 23:16:25
问题 There are many questions regarding the calculation of the receptive field. It is explained very well here on StackOverflow. However, there are no blogs or tutorials on how to calculate it in fully convolutional layer i.e. with residual blocks, feature map concatenation and upsampling layers (like feature pyramid network). To my understanding residual blocks and skip connections do not contribute to the receptive field and can be skipped. Answer from here. How are upsampling layers handled?

Test net output #0: accuracy = 1 - Always- Caffe

試著忘記壹切 提交于 2020-01-16 08:34:12
问题 I'm always getting the same accuracy. When i run the classification, its always showing 1 label. I went through many articles and everyone recommending to shuffle the data. I did that using random.shuffle and also tried convert_imageset script as well but no help. Please find my solver.protoxt and caffenet_train.prototxt below. I have 1000 images in my dataset. 833 images in train_lmdb and rest of them in validation_lmdb. Training logs: I1112 22:41:26.373661 10633 solver.cpp:347] Iteration

keras stuck during optimization

与世无争的帅哥 提交于 2020-01-15 09:19:31
问题 After trying the Keras example on CIFAR10, I decided to go for something bigger : a VGG-like net on the Tiny Imagenet dataset. This is a subset of the ImageNet dataset with 200 classes (instead of 1000) and 100K images downscaled to 64x64. I got the VGG-like model from the file vgg_like_convnet.py here. Unfortunately, things are going pretty much like here except that this time changing the learning rate or swapping TH for TF does not help. Neither changing the optimizer (see code below).

Training and Testing accuracy not increasing for a CNN followed by a RNN for signature verification

孤街浪徒 提交于 2020-01-15 05:32:45
问题 I'm currently working on online signature verification. The dataset has a variable shape of (x, 7) where x is the number of points a person used to sign their signature. I have the following model: model = Sequential() #CNN model.add(Conv1D(filters=64, kernel_size=3, activation='sigmoid', input_shape=(None, 7))) model.add(MaxPooling1D(pool_size=3)) model.add(Conv1D(filters=64, kernel_size=2, activation='sigmoid')) #RNN model.add(Masking(mask_value=0.0)) model.add(LSTM(8)) model.add(Dense(2,

How to visualize output of intermediate layers of convolutional neural network in keras?

不羁的心 提交于 2020-01-15 05:04:52
问题 recently I created basic CNN model for cats and dogs classification (very basic). How can I visualize the output of these layers using keras? I used Tensorflow backend for keras. 回答1: You can define a model that takes the output of every layer you want to see and make a prediction: Suppose you have your complete model: cnnModel = #a model you have defined with layers And suppose you want the outputs of the layers of indices 1, 5 and 8. Create a new model from this one, using the outputs of

Multiple pathways for data through a layer in Caffe

前提是你 提交于 2020-01-15 04:51:46
问题 I would like to construct a network in Caffe in which the incoming data is split up initially, passes separately through the same set of layers, and is finally recombined using an eltwise layer. After this, all the parts will move as a single blob. The layer configuration of the part of the network for which the data moves parallely will be identical, except for the learned parameters. Is there a way to define this network in Caffe without redefining the layers through which the different

Pytorch CNN error: Expected input batch_size (4) to match target batch_size (64)

末鹿安然 提交于 2020-01-15 03:31:13
问题 I've been teaching myself this since November and any help on this would be really appreciated, thank you for looking, as I seem to be going round in circles. I am trying to use a Pytorch CNN example that was used with the Mnist dataset. Now I am trying to modify the CNN for facial key point recognition. I am using the Kaggle dataset (CSV) of 7048 training images and key points (15 key points per face) and 1783 test images. I split training dataset and converted the images to jpeg, made

You must feed a value for placeholder tensor 'Placeholder' with dtype float and shape [?,784] for MNIST dataset

旧街凉风 提交于 2020-01-14 08:21:13
问题 Here is the example I am testing on MNIST dataset for quantization. I am testing my model using below code: import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from tensorflow.python.framework import graph_util from tensorflow.core.framework import graph_pb2 import numpy as np def test_model(model_file,x_in): with tf.Session() as sess: with open(model_file, "rb") as f: output_graph_def = graph_pb2.GraphDef() output_graph_def.ParseFromString(f.read()) _ = tf

Convolutional encoder error - 'RuntimeError: input and target shapes do not match'

浪尽此生 提交于 2020-01-14 03:21:09
问题 In below code three images are created, saved and a convolutional auto-encoder attempts to encode them to a lower dimensional representation. %reset -f import torch.utils.data as data_utils import warnings warnings.filterwarnings('ignore') import numpy as np import matplotlib.pyplot as plt import pandas as pd from matplotlib import pyplot as plt from sklearn import metrics import datetime from sklearn.preprocessing import MultiLabelBinarizer import seaborn as sns sns.set_style("darkgrid")