Print

Print


Hi

We all know about this limitation. I do have a MultiRunEvolve class that I
used for our in-house implementation of Neural Programming, but it is not
included in the standard release because it obviously does not work with GP.

If you decide to short-circuit the "has been defined multiple times" tests
and empty the GP static hash-tables between runs, be aware of another small
change you should do. The standard streams are closed after a run (since
multi-run was not part of the original design), so the second run will not
print on stdout. The streams are closed because some of them could be "zip"
streams, but if you don't use check-pointing you could comment out the
appropriate lines without any risk.


Gabriel Balan
P.S. if more details are needed I'd be happy to provide them, but I think we
should take the discussion offline.

-----Original Message-----
From: ECJ Evolutionary Computation Toolkit
[mailto:[log in to unmask]] On Behalf Of Jesus Karol Estrada
Sent: Wednesday, May 19, 2004 1:42 PM
To: [log in to unmask]
Subject: 10 fold cross validation

I'm trying to implement 10-fold cross validation in a GP classifier.
I need to train and test 10 times with different partitions of the data.
But when I try to run for the 2nd time Evolve.make, it returns a fatal
error.
It looks like since it's a static method, it is saving in its memory all the
data read from the parameters file.
Is there any option to restart the Evolutionary machine from zero?
Am I doing something wrong?

This is the sample code using the regression example.

package ec.app.classification.family;
import ec.*;

public class  Testing
{
        public static void main(String[] args)
        {
                String paramFileName = "ec/app/regression/erc.params";
                EvolutionState state = ec.Evolve.make(new String[] {"-file",
paramFileName});
                try {
                        state.run(EvolutionState.C_STARTED_FRESH);

                }
                catch (Exception ex)
                {
                        ex.printStackTrace();
                        System.exit(1);
                }

                EvolutionState state2 = ec.Evolve.make(new String[]
{"-file", paramFileName});
                try {
                        state2.run(EvolutionState.C_STARTED_FRESH);

                }
                catch (Exception ex)
                {
                        ex.printStackTrace();
                        System.exit(1);
                }

        }
}

And the output:

---------- java ----------

| ECJ
| An evolutionary computation system (version 10)
| Copyright 2003 by Sean Luke
| URL: http://www.cs.umd.edu/projects/plus/ec/ecj/
| Mail: [log in to unmask]
| Date: January 1, 2003
| Current Java: 1.4.2_03 / Java HotSpot(TM) Client VM-1.4.2_03-b02
| Suggested Minimum Java: 1.2.2
| Required Minimum Java: 1.1


Setting up
Processing GP Types
Processing GP Node Constraints
Processing GP Function Sets
Processing GP Tree Constraints
{0.9994835008057914,3.9948376750832253},
.....
{0.4277701109521461,0.7225182028217614},
{0.3985343905631442,0.6458899940023977},
Initializing Generation 0
Generation 1
Generation 2
...
Generation 50

| ECJ
| An evolutionary computation system (version 10)
| Copyright 2003 by Sean Luke
| URL: http://www.cs.umd.edu/projects/plus/ec/ecj/
| Mail: [log in to unmask]
| Date: January 1, 2003
| Current Java: 1.4.2_03 / Java HotSpot(TM) Client VM-1.4.2_03-b02
| Suggested Minimum Java: 1.2.2
| Required Minimum Java: 1.1


Setting up
Processing GP Types
FATAL ERROR:
The GP type "nil" has been defined multiple times.
PARAMETER: gp.type.a.0.name

Output completed (6 sec consumed) - Normal Termination


Also tried with:
                EvolutionState state = ec.Evolve.make(new String[] {"-file",
paramFileName, "-p","-nostore=true"});
Is that correct?