AIMA.Core.Learning.Neural.NNDataSet.getExampleAtRandom C# (CSharp) Method

getExampleAtRandom() public method

public getExampleAtRandom ( ) : NNExample
return NNExample
        public NNExample getExampleAtRandom()
        {

            int i = Util.randomNumberBetween(0, (presentlyProcessed.Count - 1));
            NNExample result = presentlyProcessed[i];
            presentlyProcessed.RemoveAt(i);
            return result;
        }

Usage Example

	public void trainOn(NNDataSet innds, int numberofEpochs) {
		for (int i = 0; i < numberofEpochs; i++) {
			innds.refreshDataset();
			while (innds.hasMoreExamples()) {
				NNExample nne = innds.getExampleAtRandom();
				processInput(nne.getInput());
				Vector error = getOutputLayer()
						.errorVectorFrom(nne.getTarget());
				processError(error);
			}
		}

	}
All Usage Examples Of AIMA.Core.Learning.Neural.NNDataSet::getExampleAtRandom