[Insight-users] Implementing the Neural Network classes
Nikhil Chandwadkar
nikhil.chandwadkar at gmail.com
Thu Apr 26 08:59:01 EDT 2012
Hi,
I have been trying to use the ITK neural network classes and I'm having
problems with both the classes in the Statistics namespace as well as the
I/O classes in the itk namespace. All classes in the neural networks module
seem to be lacking a good amount of documentation. Going by the fact that,
there haven't been any issues at all on the mailing list, I'm assuming that
people haven't used them much (or I'm dumb :) ). So, any solutions or
guidance is most welcome.
I have tried out two things:
1. Train the network from measurement vectors and target vectors read from
a file (a subset of the available measurement vectors) and simulate the
network on the entire set of measurement vectors available immediately
using network->GenerateOutput(mv), writing the outputs into another file.
2. Train the network as above in a TrainNetwork() function and using the
NeuralNetworkFileWriter class and write a neural network file
FileWriter->SetInput(network). Then read the file using the
NeuralNetworkFileReader class and simulate the network in a separate
SimulateNetwork() function.
Case 1:
I'm using a one hidden layer network, following the example in
Modules/Numerics/NeuralNetworks/NNetClassifierTest1.cxx. Just like in the
example, I'm reading measurement vectors and target vectors from a file and
using a BatchSupervisedTrainingFunction to train the samples. In addition
I'm also using the Tan Sigmoid transfer function for the hidden layer and
the output layer and ErrorBackPropagationLearningWithMomentum as the
learning function. After training the network (And this takes too long.
Much longer than Matlab at least) when I generate the output vector, most
outputs have the same value, say 0.35467, all to the same precision. There
are one or two values that are negative too. I've no idea how to make sense
from this. Plus, when the training sample is large, around 3000 measurement
vectors, I get all outputs as -1 from the trained network.
Case 2:
On writing the network to a file, reading it and simulating it, I get all
output values as -0.414.. always, irrespective of whatever network I've
trained (majority of weight values as written in the file are zeroes).
I'm guessing that I'm missing something quite fundamental or there is
something wrong with the classes. Have these classes been tested enough?
Any help whatsoever is most welcome.
Regards,
Nikhil Chandwadkar,
Indian Institute of Technology Madras,
Chennai,
India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120426/49ab01f0/attachment.htm>
More information about the Insight-users
mailing list