jeffheaton / encog-java-core

http://www.heatonresearch.com/encog
Other
742 stars 268 forks source link

Exception on method generate of ElmanPattern #247

Open AleZonta opened 6 years ago

AleZonta commented 6 years ago

In ElmanPattern class, the method generate() is producing an exception. The following line is the one throwing the exception.

final BasicNetwork network = new BasicNetwork();

Method threw 'org.encog.neural.NeuralNetworkError' exception. Cannot evaluate org.encog.neural.networks.BasicNetwork.toString()

jeffheaton commented 6 years ago

Thank you, I will take a look.

jeffheaton commented 6 years ago

Do you happen to have any code to reproduce this issue? I don't think it is possable for the BasicNetwork constructor to throw an exception. I tried the following code, which works fine:

        ElmanPattern elmanPat = new ElmanPattern();
        elmanPat.setInputNeurons(5);
        elmanPat.addHiddenLayer(5);
        elmanPat.setOutputNeurons(1);
        BasicNetwork network = (BasicNetwork) elmanPat.generate();
        System.out.println(network.toString());