public Network(double learningrate, double alpha, double mininitweight, double maxinitweight, int numInputNeurons, int[] hiddenLayerSizes, int numOutputNeurons, bool testHaltEnabled = false, bool testingEnabled = true, bool recordSaveEnabled = true) { Console.WriteLine("\n Building neural network..."); if (numInputNeurons < 1 || hiddenLayerSizes.Length < 1 || numOutputNeurons < 1) { throw new Exception("Incorrect Network Parameters"); } Functions.Alpha = alpha; Synapse.MinInitWeight = mininitweight; Synapse.MaxInitWeight = maxinitweight; LearningRate = learningrate; this.testStrategy = new MeanErrorTest(this); this.TestHaltEnabled = testHaltEnabled; this.TestingEnabled = testingEnabled; this.RecordSaveEnabled = recordSaveEnabled; Layers = new List <Layer>(); AddFirstLayer(numInputNeurons); for (int i = 0; i < hiddenLayerSizes.Length; i++) { AddNextLayer(new Layer(hiddenLayerSizes[i])); } AddNextLayer(new Layer(numOutputNeurons)); SynapsesCount = Synapse.SynapsesCount; ErrorFunctionChanges = new double[Layers.Count][]; for (int i = 1; i < Layers.Count; i++) { ErrorFunctionChanges[i] = new double[Layers[i].Neurons.Count]; } }
public IEnumerable <UITest> GetTestMethods() { Assembly assembly; try { assembly = Assembly.LoadFrom(this.assemblyPath); } catch (Exception e) { Log.Fatal(e, "There was as issue loading the assembly"); throw e; } ITestStrategy testStrategy = this.testStrategy switch { TestStrategy.NUnit => new NUnitStrategy(), _ => new SpecflowPlusStrategy() }; return(testStrategy.GetTests(assembly)); } }
public TestContext(ITestStrategy strategy) { this.strategy = strategy; }