Results 1 to 5 of 5
Thread: array error
- 04-23-2010, 08:52 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 9
- Rep Power
- 0
array error
Exception in thread "main" java.lang.NullPointerException
at org.encog.neural.networks.training.propagation.bac k.Backpropagation.<init>(Unknown Source)
at neural_network.NetworkTrain.training(NetworkTrain. java:35)
at neural_network.Main.main(Main.java:17)
public class NetworkTrain
{
public static void training (){
final File file = new File(Names.NETNAME);
final EncogPersistedCollection encog = new EncogPersistedCollection(
file);
//create the network dataset
double netinput [][] ={
{0.3140,0.31370,0.31340,0.31310,0.31310,0.31360,0. 31390,
0.31480,0.31720,0.31770}
};
double netideal [][] = {
{0.31780}
};
NeuralDataSet traindata = new BasicNeuralDataSet(netinput, netideal);
final BasicNetwork network = (BasicNetwork) encog
.find(Names.NETNAME);
// train the neural network
final Train train = new Backpropagation(network, traindata, 0.7, 0.2);
int epoch = 1;
I'm having lots of problems with my neural network. This is the error i get and my code.
Please help.
- 04-23-2010, 12:28 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Check if "network" is null.
- 04-23-2010, 07:17 PM #3
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
provide us the object code
NeuralDataSet traindata = new BasicNeuralDataSet(netinput, netideal);
- 04-23-2010, 08:51 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
No, the exception stack trace showed this:
so the OP'd better show us line 35 of the file NetworkTrain.java, because that line is on the track where the exception occurred; don't obfuscate people by writing nonsense and please don't beg for rep points, that is so adolescent. You haven't supplied (m)any useful answers yet.Java Code:at neural_network.NetworkTrain.training(NetworkTrain. java:35)
kind regards,
Jos
- 04-25-2010, 12:18 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Since the actual exception is thrown from:
at org.encog.neural.networks.training.propagation.bac k.Backpropagation.<init>(Unknown Source)
and the only line doing an init on Backpropagation is:
final Train train = new Backpropagation(network, traindata, 0.7, 0.2);
I would guess that that's line 35, so either network or traindata is null, and traindata is initialised two lines beforehand...
Of course, it could be some other internal thing to Backpropagation, but I would lay odds on it being network is null.
Similar Threads
-
Can't Solve Array Error
By Gregadeaux in forum New To JavaReplies: 2Last Post: 12-14-2009, 03:01 AM -
Error if array contains duplicate integers
By lithium002 in forum New To JavaReplies: 4Last Post: 12-05-2009, 08:58 AM -
Thread: Error 500--Internal Server Error java.lang.NullPointerException
By jackdear44 in forum New To JavaReplies: 1Last Post: 12-05-2009, 07:28 AM -
How to add an integer to a array element and the store that backinto an array.
By Hannguoi in forum New To JavaReplies: 1Last Post: 03-31-2009, 06:40 AM -
Diference Between compiler error Garbage collection and Runtime Error?
By makpandian in forum New To JavaReplies: 3Last Post: 01-23-2009, 08:53 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks