jeffheaton / encog-java-core

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

Workbench: Analyst generates C# code that doesn't compile #145

Closed PetrToman closed 10 years ago

PetrToman commented 11 years ago

Workbench has an option to generate a basic code skeleton, which looks like this:

using Encog.ML;
using Encog.ML.Data;
using Encog.Util.Simple;

namespace EncogGenerated
{
    // Code generated by Encog v3.2.0
    // Generation Date: Thu Jul 25 07:01:56 CEST 2013
    // Generated code may be used freely
    // http://www.heatonresearch.com/encog
    public class EncogExample
    {

        public static MLDataSet createTraining() {
            IMLDataSet result = EncogUtility.LoadEGB2Memory(new File("C:\data_train.egb"));
            return result;
        }

        public static IMLMethod createNetwork()
        {
            IMLMethod result = (IMLMethod)EncogDirectoryPersistence.LoadObject(new File("C:\data_train.eg"));
            return result;
        }

        static void Main(string[] args)
        {

            IMLMethod method = createNetwork();

            IMLDataSet training = createTraining();
            // Network and/or data is now loaded, you can add code to train, evaluate, etc.
        }
    }
}

...but there are several errors:

jeffheaton commented 10 years ago

Fixed the code generation and tested with visual studio.