Training neural network in matlab - matlab

I have multiple .mat files. In each file I saved multiple features of an image (like intensity, hue etc). I want to train a neural network to categorize these images. I already have excel file containing the output categories of each image.
Now question is that I have to load all the .mat files and fed it as input to neural network or I have to take only single file each time and its corresponding output category. Can anyone please clarify this?
Also how can I give multiple .mat files containing multiple variables as input to a neural network?

maybe is the best to load all .mat files which contain parameters you want to use for training of neural network and put all your input parameters into one variable, and than to use that variable as the input for neural network.

Related

Loading a dataset in parts for training a neural network

This is my first post so please ask me if something is not clear.
I am currently working on training a neural network on a custom dataset that I have created. This dataset consists of 1000 folders which contain 81 images (512x512 px) each that are going to be loaded, processed and used as an input. My issue is that my computer cannot handle such a large dataset and I have to find a way to use the whole dataset.
The neural network that I am working on can be found here https://github.com/chshin10/epinet.
On the EPINET_train.py file you can see the data generator that is being used.
The neural network uses the RMSProp optimizer.
What I did to deal with this issue is that I split the data into 2 folders one for training and one for testing with an 80%-20% split. Then I load 10% of the data from each folder in order to train the neural network (data was not chosen randomly). I train the neural network for 100 epoches and the I load the next set of data until all of the sets have been used for training. Then I repeat the procedure.
After 3 iterations it seems to me that the loss function is not getting minimized more for each set of data. Is this solution used in a similar scenario? Is there something I can do better.

How to create a neural network that receive multiple input images in Matlab

I'd like to know if it's possible to create a neural network that receive multiple input images (imageInputLayer)
For example a Siamese architecture for computing the disparity (stereo correspondence) out of two image patches. The network input is two images and the output is a scalar that represent the disparity.
Currently matlab supports a single imageInputLayer for each neural network.
I'd like to to classify a 3D object by projecting the 3D object through 3 angles, Therefor converting the problem to classification of 3 images.
I'm trying to create a network that looks like the attached image.
Please let me know what you think and how to work things out with the network input
This is simply not possible in Matlab 2018B

How to simulate neural network by changing different parameters after training in MATLAB?

I have trained the neural network for a particular time series in MATLAB. After that I have saved the network. So if I want to simulate the network using different parameters like changing the number of neurons,number of hidden layer, transfer functions, learning ratio,momentum coefficient, Can I do it without again training the network?
If not what is the criteria to select the best parameter for my neural network?
How should I configure my neural network in MATLAB to do all these?
No because you save whole model to file, with including weights + activation function and whole structure (layers). You can train few networks, and save to file if you want to check in future on real data (validation data) which networks is better.
Check this also ;) http://people.cs.umass.edu/~btaylor/publications/PSI000008.pdf

How to create a Skip-Layer feedforward neural network in MATLAB?

I would like to create a neural network with skip layer connections in MATLAB. Is there any way to modify "newff" function to allow for direct connections from input nodes to output layer?
In case you haven't found a solution for this yet, I had a similar problem. Note that if you have a look at the cell arrays net.IW and net.LW you can modify the adjacency matrices within these structures and essentially modify the weights of the connections in the neural networks any way you want, including connections from the input layer to any other layer (including the output) for example. You then just need to modify these matrices so that you'll get the skip-layer structure you desire.
For more information check this question out, it is similar to what you're asking.

Using feature vector .mat file for LIBSVM in matlab

I'm new to matlab as well as LIBSVM. I calculated feature vector for every point stating r,g,b values of point in single vector and stored it in .mat file. Currently I'm having around 420 points and 4 classes viz Red/Green/Blue/Other. Now I want to pass this .mat file to train libsvm and based on that classify the newly arriving test point, whether it is red or blue or green or other. Need not to mention, its a multiclass classification and I don't even know how to deal with it ?
svmtrain(TrainingSet,Groups,'kernel_function','rbf'); where TrainingSet is my 420*4 feature vector set and Groups is class name.
Thanks in advance for help.