how to train a neural network with a matrix as input

For now, I have got my feature matrix( x_train), which is 25 * 1000, each column is one train data and each train data has a dimension of 25 feature.
Also, I get my target matrix(y_train), which is 27 * 1000, each column is the corresponding label of the train data. Each column looks like [1 0....0] or [0 1 0...0] or [0 0 1 ... 0], because there are 27 different kinds of labels, and I try to represent them as vector.
Then, I create a feedforward neutral network with
net = feedforwardnet(10)
and train by
net = train(net,x_train,y_train)
After that, I try to make a prediction with this trained net. However, it gives a result like
0.0407
0.2103
-0.7430
2.1438
0.2586
0.1181
-0.2998
1.0055
0.3115
-0.7575
-0.7809
0.7042
1.0576
-0.4813
1.2649
1.0238
0.0825
0.1803
1.3886
0.5525
-0.4226
1.0090
1.8860
-0.1083
-0.2245
1.2130
0.2512
In my expection, it should output something like the labels, [1 0...0] or [0 0 0 0 1 0....0].
How can I do it correctly?

Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 11 Dec 2018

Edited:

on 11 Dec 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!