Hands-On Machine Learning with C#: Build smart, speedy, and reliable data-intensive applications using machine learning by R. Cole Matt

Hands-On Machine Learning with C#: Build smart, speedy, and reliable data-intensive applications using machine learning by R. Cole Matt

Author:R. Cole, Matt
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2018-05-24T16:00:00+00:00


// iterations

int i = 0;

// loop

while (!needToStop)

{

trainer.LearningRate = driftingLearningRate

* (iterations - i) / iterations + fixedLearningRate;

trainer.LearningRadius = (double)learningRadius *

(iterations - i) / iterations;

// run training epoch

trainer.RunEpoch(trainingSet);

// update map

UpdateMap(network);

// increase current iteration

i++;

// set current iteration's info

SetText(currentIterationBox, i.ToString());

// stop ?

if (i >= iterations)

break;

}

As we mentioned earlier, the LearningRate and LearningRadius continue to evolve through every iteration. This time, let's talk a bit about the RunEpoch method of the trainer. This method, although very simplistic, is designed to take a vector of input values and then return a learning error for that iteration (as you can now see, also sometimes called an epoch). It does this by calculating against each one of the input samples in the vector. The learning error is the absolute difference between the neurons' weights and inputs. The difference is measured according to the distance from the winning neuron. As mentioned earlier, we run this calculation against one learning iteration/epoch, find the winner, and update its weights (as well as neighbor weights). I should point out that when I say winner, I mean the neuron that has weights with values closest to the specified input vector, that is, the minimum distance from the network's input.

Next, we will highlight how we update the map itself; our calculated projects should match the initial input vector (points):

// get first layer

Layer layer = network.Layers[0];



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.