neural-network

What is purpose of ifelse and switch in theano?

牧云@^-^@ 提交于 2019-12-12 18:35:02
问题 I am not able to understand anything about them, I read it from http://deeplearning.net/software/theano/tutorial/conditions.html. I suppose they function like our ifelse but not able to understand how to use them. Please some guide on this. Thanks 回答1: I would think of it as just another operator that acts on three symbolic variables, if the first is true, return the second, else return the third. But for many operators (like - and + ) theano has overloaded them for symbolic variables, so

ReLU not learning to handle negative inputs Keras / Tensorflow

五迷三道 提交于 2019-12-12 17:35:29
问题 I want my neural network to convert a negative value into a positive value. Theoretically this can be done using a ReLU function and 1 node which learns the input weight to be -1 (so a negative input is multiplied by -1 = positive input. It just keeps on outputting 0. Code below. I used -1 as input values to see if it could learn on at least a single input. I tried adding more layers but it doesn't help see edit, IT DID help if I add more train_input = np.asarray([[-1]]*10000) # Input arr of

Train neural network with sine function

断了今生、忘了曾经 提交于 2019-12-12 17:27:31
问题 I want to train a neural network with the sine() function. Currently I use this code and the (cerebrum gem): require 'cerebrum' input = Array.new 300.times do |i| inputH = Hash.new inputH[:input]=[i] sinus = Math::sin(i) inputH[:output] = [sinus] input.push(inputH) end network = Cerebrum.new network.train(input, { error_threshold: 0.00005, iterations: 40000, log: true, log_period: 1000, learning_rate: 0.3 }) res = Array.new 300.times do |i| result = network.run([i]) res.push(result[0]) end

How can I convert data which form is matlab file to LMDB as my caffe input?

别说谁变了你拦得住时间么 提交于 2019-12-12 17:20:15
问题 I have a data set which form is matlab file. The data set contains 600,000 samples and every sample is a matrix of 7-by-256. My data is not image but signal. I want to use CNN of caffe to train the data. So how can I convert it to LMDB as my input of CNN. I'm badly need the solution! 回答1: Converting data in matlab directly to lmdb might be a little tricky. Why don't you try exporting your data to hdf5 binary files (supported both by matlab and caffe)? Here is an answer describing how this can

Missing values for the data to be used in a Neural Network model for prediction

≡放荡痞女 提交于 2019-12-12 16:48:40
问题 I currently have a lot of data that will be used to train a prediction neural network (gigabytes of weather data for major airports around the US). I have data for almost every day, but some airports have missing values in their data. For example, an airport might not have existed before 1995, so I have no data before then for that specific location. Also, some are missing whole years (one might span from 1990 to 2011, missing 2003). What can I do to train with these missing values without

Merge weights of same model trained on 2 different computers using tensorflow

荒凉一梦 提交于 2019-12-12 16:18:42
问题 I was doing some research on training deep neural networks using tensorflow. I know how to train a model. My problem is i have to train the same model on 2 different computers with different datasets. Then save the model weights. Later i have to merge the 2 model weight files somehow. I have no idea how to merge them. Is there a function that does this or should the weights be averaged? Any help on this problem would be useful Thanks in advance 回答1: It is better to merge weight updates

Matrix dimensions not matching in back propagation

不羁的心 提交于 2019-12-12 15:30:23
问题 Here I'm attempting to implement a neural network with a single hidden layer to classify two training examples. This network utilizes the sigmoid activation function. The layers dimensions and weights are as follows : X : 2X4 w1 : 2X3 l1 : 4X3 w2 : 2X4 Y : 2X3 I'm experiencing an issue in back propagation where the matrix dimensions are not correct. This code : import numpy as np M = 2 learning_rate = 0.0001 X_train = np.asarray([[1,1,1,1] , [0,0,0,0]]) Y_train = np.asarray([[1,1,1] , [0,0,0]

Problems while using ScikitLearn's Neural Network implementation

北战南征 提交于 2019-12-12 13:26:24
问题 I am trying to implement image processing using Neural Network implementation given by Scikit Learn. I have close to 10,000 color images in 'JPG' format, I converted those images into 'PNG' format and removed the color information. The new images are all Black OR White images. After converting these images into vector format, these image vectors formed the input to the Neural Network. To each image, there is an output as well which forms the output of the Neural Network. The input file only

What does Caffe Train/Test net output mean?

若如初见. 提交于 2019-12-12 13:07:40
问题 When training in Caffe, there are Train and Test net outputs for each iteration. I know this is the loss. However, is this the average loss over my batch or the total loss? And is this the same for both Classification and Regression? For example, if I were to have a batch of 100 training examples and my loss over that iteration is 100, does that mean that the average loss per example is 1? 回答1: Train loss is the averaged loss over the last training batch. That means that if you have 100

plotting spectrogram in audio analysis

谁说我不能喝 提交于 2019-12-12 12:17:31
问题 I am working on speech recognition using neural network. To do so I need to get the spectrograms of those training audio files (.wav) . How to get those spectrograms in python ? 回答1: There are numerous ways to do so. The easiest is to check out the methods proposed in Kernels on Kaggle competition TensorFlow Speech Recognition Challenge (just sort by most voted). This one is particularly clear and simple and contains the following function. The input is a numeric vector of samples extracted