neural-network

Inputs not a sequence wth RNNs and TensorFlow

社会主义新天地 提交于 2020-01-05 05:45:11
问题 I have some very basic lstm code with tensorflow and python, where my code is output = tf.nn.rnn(tf.nn.rnn_cell.BasicLSTMCell(10), input_flattened, initial_state=tf.placeholder("float", [None, 20])) where my input flattened is shape [?, 5, 22501] I'm getting the error TypeError: inputs must be a sequence on the state parameter of the lstm, and I'm ripping my hair out trying to find out why it is giving me this error. Any help would be greatly appreciated. 回答1: I think when you use the tf.nn

Data Augmentation for Object Detection using Deep Learning

一世执手 提交于 2020-01-05 05:43:06
问题 I have a question regarding data augmentation for training the deep neural network for object detection. I have quite limited data set (nearly 300 images). I augmented the data by rotating each image from 0-360 degrees with stepsize of 15 degree. Consequently I got 24 rotated images out of just one. So in total, I got around 7200 images. Then I drew bounding box around the object of interest in each augmented image. Does it seem to be a reasonable approach to enhance the data? Best Regards

Deep autoencoder in Keras converting one dimension to another i

て烟熏妆下的殇ゞ 提交于 2020-01-05 04:19:33
问题 I am doing an image captioning task using vectors for representing both images and captions. The caption vectors have a legth/dimension of size 128. The image vectors have a length/dimension of size 2048. What I want to do is to train an autoencoder, to get an encoder which is able to convert text vector into a image vector. And a decoder which is able to convert an image vector into a text vector. Encoder: 128 -> 2048. Decoder: 2048 -> 128. I followed this tutorial to implement a shallow

In what ways are the output of neural network layers useful?

假如想象 提交于 2020-01-04 07:25:07
问题 I'm currently working with keras and want to visualize the output of each layer. When having a visualisation of a layer of a neural networks output, like the example below, which is for MNIST handwriting number recognition. What information or insight does a researcher gain from these images How are these images interpreted If you would choose to see the output of a layer, what are your criteria for selection? Any comment or suggestion is greatly appreciated. Thank you. 回答1: Preface: A

Time series forecast with recurrent Elman network in neurolab

送分小仙女□ 提交于 2020-01-04 06:12:41
问题 I use the Elman recurrent network from neurolab to predict a time series of continuous values. The network is trained from a sequence such that the input is the value at index i and the target is the value at index i+1 . To make predictions beyond the immediate next time step, the output of the net is feed back as input. If, for example, I intend to predict the value at i+5 , I proceed as follows. Input the value from i Take the output and feed it to the net the as next input value (e.g. i+1

BackPropagation Neuron Network Approach - Design

喜你入骨 提交于 2020-01-04 05:36:15
问题 I am trying to make a digit recognition program. I shall feed a white/black image of a digit and my output layer will fire the corresponding digit (one neuron shall fire, out of the 0 -> 9 neurons in the Output Layer). I finished implementing a Two-dimensional BackPropagation Neuron Network. My topology sizes are [5][3] -> [3][3] -> 1[10]. So it's One 2-D Input Layer, One 2-D Hidden Layer and One 1-D Output Layer. However I am getting weird and wrong results (Average Error and Output Values).

Binarize tensor in Keras

落花浮王杯 提交于 2020-01-04 05:36:10
问题 I need to create a loss function for Keras that works with only binary values. In wanted for to transform all the values greater than 0.5 to 1.0, so I did that: def MyLoss(y_true, y_pred: y_true_f = K.flatten(y_true) y_pred_f = K.flatten(K.cast(K.greater(y_pred, 0.5), 'float32')) #y_pred_f = K.flatten(K.cast(y_pred > 0.5), 'float32') #y_pred_f = K.flatten(y_pred > 0.5) return K.sum(y_true_f * y_pred_f) The code compiles, but later it generates the following error: ValueError: None values not

Tensorflow: _variable_with_weight_decay(…) explanation

好久不见. 提交于 2020-01-04 04:26:07
问题 at the moment I'm looking at the cifar10 example and I noticed the function _variable_with_weight_decay(...) in the file cifar10.py. The code is as follows: def _variable_with_weight_decay(name, shape, stddev, wd): """Helper to create an initialized Variable with weight decay. Note that the Variable is initialized with a truncated normal distribution. A weight decay is added only if one is specified. Args: name: name of the variable shape: list of ints stddev: standard deviation of a

Caffe: How to get `solver.prototxt` parameters by code?

点点圈 提交于 2020-01-04 03:18:07
问题 I want to access the solver.prototxt parameters such as base_lr (Base Learning Rate) or weight_decay from python code. is there any way to access these from the solver.net object ? Thank you 回答1: According to this tutorial, you can access it by : ### define solver from caffe.proto import caffe_pb2 s = caffe_pb2.SolverParameter() # Set a seed for reproducible experiments: # this controls for randomization in training. s.random_seed = 0xCAFFE # Specify locations of the train and (maybe) test

Training in batches but testing individual data item in Tensorflow?

半世苍凉 提交于 2020-01-03 16:46:59
问题 I have trained a convolution neural network with batch size of 10. However when testing, I want to predict the classification for each dataset separately and not in batches, this gives error: Assign requires shapes of both tensors to match. lhs shape= [1,3] rhs shape= [10,3] I understand 10 refers to batch_size and 3 is the number of classes that I am classifying into. Can we not train using batches and test individually? Update: Training Phase: batch_size=10 classes=3 #vlimit is some