mfajnberg / tensorevo

0 stars 1 forks source link

Update the validation error/fitness in the SGD step method #4

Closed daniil-berg closed 11 months ago

daniil-berg commented 1 year ago

After #3 is resolved, instead of re-calculating the validation error within the for-loop of the SGD method

https://github.com/mfajnberg/tensorevo/blob/b7119f3c89b17d45ae3c3a49022f0f93a555ba97/src/individual.rs#L172-L182

we should pass the optional validation data on to the stochastic_gradient_descent_step method and update the validation error at the end of that (if necessary).

While we are at it, we can also get rid of the match expression by simply calling the option's map method with a closure that does the updating since the None case is no-op.