public EasyChangeEvaluator(NeatEvolutionAlgorithm <NeatGenome> ea, EasyChangeDataLoader dataLoader, int maxGen, double testPorcentage) { _ea = ea; trainingMode = true; _maxGen = maxGen; _stopConditionSatisfied = false; moleculeCaracteristics = dataLoader.MoleculeCaracteristics; _totalImageCount = dataLoader.TotalImageCount; _pixelCount = dataLoader.PixelCount; allIdentifiers = dataLoader.AllIdentifiers; allImages = dataLoader.AllImages; testClases = dataLoader.TestClases; double temp = _totalImageCount * (1 - testPorcentage); separation = (int)temp; }
/// <summary> /// Initialize the experiment with some optional XML configuration data. /// </summary> public void Initialize(string name, XmlElement xmlConfig) { _name = name; _populationSize = XmlUtils.GetValueAsInt(xmlConfig, "PopulationSize"); _specieCount = XmlUtils.GetValueAsInt(xmlConfig, "SpecieCount"); _activationScheme = ExperimentUtils.CreateActivationScheme(xmlConfig, "Activation"); _complexityRegulationStr = XmlUtils.TryGetValueAsString(xmlConfig, "ComplexityRegulationStrategy"); _complexityThreshold = XmlUtils.TryGetValueAsInt(xmlConfig, "ComplexityThreshold"); _description = XmlUtils.TryGetValueAsString(xmlConfig, "Description"); _parallelOptions = ExperimentUtils.ReadParallelOptions(xmlConfig); _seed = XmlUtils.GetValueAsInt(xmlConfig, "Seed"); _datasetPath = XmlUtils.TryGetValueAsString(xmlConfig, "DatasetPath"); _normalizeData = XmlUtils.GetValueAsBool(xmlConfig, "NormalizeData"); _normalizeRange = XmlUtils.GetValueAsInt(xmlConfig, "NormalizeRange"); _dataLoader = new EasyChangeDataLoader(); _eaParams = new NeatEvolutionAlgorithmParameters(); _eaParams.SpecieCount = _specieCount; _neatGenomeParams = new NeatGenomeParameters(); _neatGenomeParams.FeedforwardOnly = _activationScheme.AcyclicNetwork; _neatGenomeParams.ActivationFn = LeakyReLU.__DefaultInstance; _maxGen = XmlUtils.GetValueAsInt(xmlConfig, "MaxGen"); _testPorcentage = (XmlUtils.GetValueAsInt(xmlConfig, "TestPorcentage") * 1.0) / 100; _savePeriod = XmlUtils.GetValueAsInt(xmlConfig, "SavePeriod"); }