Hot questions for Using Neural networks in networking
I want to build a CNN in Torch to classify (small) audio recordings. I have some samples, each with 16608x1 samples (I can compress them if they are too big). There are about 300 samples (900 if needed, but I want to try with this smaller set first) to be classified into 30 classes.
Here's what I've written so far:
net = nn.Sequential() -- 1 net:add( nn.TemporalConvolution(1, 640, 1529) ) net:add( nn.TemporalMaxPooling(4) ) net:add( nn.LogSoftMax() ) -- 2 net:add( nn.TemporalConvolution(640, 15, 647) ) net:add( nn.TemporalMaxPooling(9) ) net:add( nn.LogSoftMax() ) -- review net:add( nn.View(347 * 15) ) net:add( nn.Linear(347 * 15, 450) ) net:add( nn.ReLU() ) net:add( nn.Linear(450, 128) ) net:add( nn.ReLU() ) net:add( nn.Linear(128, 30) ) net:add( nn.LogSigmoid() ) -- class setup -- mean to 0, stdv to 1 criterion = nn.ClassNLLCriterion() trainer = nn.StochasticGradient(net, criterion) trainer.learningRate = 0.01 trainer.maxIteration = 15 trainer:train(trainset)
When I run it, there's an error in
ClassNLLCriterion.c with error on the
assertion (cur_target >= 0 && cur_target < n_classes).
Also, all numbers are experimental and I'm experimenting (this is one of my first CNN)
It seems that your target class is out of range. You defined the network to have 30 classes as output of your network, but perhaps your trainset has < 1 or > 30 classes.
Also, be aware that in torch classes are indexed 1 to N.
I'm currently working on the java's neural network framework "neuroph" and I have a question regarding the types of the data in the data sets.
Is there anyway to use a data set that contains words and numbers as a training set? Because when I uploaded a data set with such criteria I am getting "NaN", which simply means the network is not receiving any data. I'm providing IP addresses in my data sets and types of protocols "UDP/TCP" as well as part of the data in the data set.
When I manually feed in a single line of data from my data set into the network to sort of analyze what the problem is, it gives me the error that the provided input is of invalid input format. So I'm wondering, is there a way to provide non-numerical values as input to my network?
Thanks in advance
Short answer: If you are using DataSetRow, then no.
This class only accepts
double as input.
You can, of course, implement your own class:
public class MyDataSet extends DataSetRow, but you would still need to convert from your datatype to
If you are using IP address as input, why not break it in four numbers?
For example, the IP
18.104.22.168 would be the input
[1, 2, 3, 4]
Do you know about Weka? (https://www.cs.waikato.ac.nz/ml/weka/)
This is an example dataset used with Weka: http://storm.cis.fordham.edu/~gweiss/data-mining/weka-data/soybean.arff
As you can see, it accepts Strings as input, and maybe can help you achieve your goal.