In MATLAB , NANs in during training neural network - matlab

I encountered a very strange problem while using Matlab 2016a Using a neural network built into the Perceptron NNtool toolbox, I try to predict a nonlinear variable. However, during training, the values obtained are for testing and training and validation of NANs. I tried to change the learning speed and hide the layers, but nothing worked. Do you have any idea, why is this so? Any help is greatly appreciated!

Related

Neural Network Regression for Winequality Data [predicting density]

I am trying to run my neural network code but it showed an error. My code as per below.. wondering what i missed out. I am trying to predict the MSE value for the model and compare it with Linear regression.

SVM Vs Deep Neural Network

I am trying to solve a regression problem by comparing different machine learning algorithms. So far i have tried Linear Regression) (accuracy: 0.88) and SVM ( Accuarcy : 0.84). Now i am trying to neural network for the same problem but i am getting a very low accuracy ( around 1 Percent!) I cant seem to figure out if i am using the same data, then why am i getting such low acccuracy using the neural network?
I have tried using different number of neurons but nothing seems to work. Here is the neural network that i am using Neural Network
I expect the accuracy to be somewhere near to SVM and linear regression but it does not seem to work. My labels look like this labels
My features look like this. features.Here is the output of the neural network Neural Network Output
Looks like you are doing a regression task on your data, accuracy is a classification metric and can only be used for classification, not regression, so your results are meaningless and you cannot compare regressors using accuracy.
Just use another metric like mean squared error or mean absolute error.

SVM-Classification of multiclass

I've used Matlab Classification Learner App to train my SVM classifier and i have 99.9% of accuracy in prediction (i tested it with the function predict on matlab). What i wanted to do now was to predict without usind this function but using the hyperplane. I exported the trained classifier and so i have all the weights and the bias to find the hyperplane. Which formula should i use to predict new data? I tryed computing the sign of w'x but it works only in few cases. Can you help me understand what should i do?
Thanks a lot!

Why doesn't my neural network learn a rule, even when trained on a large dataset?

I can't get my neural network to perform well at all. It is supposed to classify a 21-bit encoded input into binary yes or no outputs. The division of yes:no targets is roughly 20:80. At first I had a small data set, so I acquiesced to it outputting close to 100% 'no'. But now I have ~20,000 records, and it still outputs 'no' ~100% of the time. Why is it incapable of learning the rule for classifying an input as 'yes', does anyone know what I am doing wrong?
My input vector is 21x18942. My target vector is 2x18942. I don't do anything fancy with the neural network, the code is simply
net=patternnet(20)
a = sim(net,targets);
[net,tr] = train(net,inputs,targets);
outputs = net(inputs);
plotconfusion(targets, outputs)
and I have tried other standard neural networks available within matlab, e.g. net = feedforwardnet(10, 'traingd'); with the same result.
Does anyone have an idea what I am doing wrong, or if there is some sort of limitation to these matlab neural network toolboxes that is causing a problem?
Any thoughts here would be very much appreciated

Matlab - Create RBF Network without using Neural Network Toolbox

In the lectures we only mention how to train the RBF network with Gausian function and how to use the "newrb" tool box in Matlab. But in the assignemnet I need to create my own RBF network which using the NN toolbox is forbidden. Basically I not even know how to start it and our professor not willing to provide any information.
With some tips I have write my own program but the performance is very bad, I am wonder if any one can give me some helpful tutorial or guides that how to create the RBF network with Gaussian function without using NN toolbox.
I have used k-means to obtain the centers and gaussian function to caculuate the weights, the main probrlem is that I have no idea how to design the method that transform the Input matrix to the RBF matrix. Hope you can help.
This is clearly homework, and it's not clear what your question is. But I think you are wondering how to create the Gram matrix. If so, see:
http://en.wikipedia.org/wiki/Gramian_matrix
You should have the math for how to do each step in your textbook and/or notes.