/// <summary> /// Implements a simple build process controller which stops the build process when /// an average absolute error is less than 1e-4. /// </summary> private TNRNetBuilder.BuildInstr NetworkBuildController(TNRNetBuilder.BuildProgress buildProgress) { bool currentIsBetter = IsBetter(buildProgress.CurrNetwork, buildProgress.BestNetwork ); TNRNetBuilder.BuildInstr instructions = new TNRNetBuilder.BuildInstr { CurrentIsBetter = currentIsBetter, StopProcess = (currentIsBetter && buildProgress.CurrNetwork.CombinedPrecisionError < 1e-4) }; return(instructions); }
/// <summary> /// Displays information about the network build process progress. /// </summary> /// <param name="buildProgress">The current state of the build process.</param> private void OnNetworkBuildProgressChanged(TNRNetBuilder.BuildProgress buildProgress) { const int leftMargin = 4; const int reportEpochsInterval = 5; //Progress info if (buildProgress.ShouldBeReported || (buildProgress.EndNetworkEpochNum % reportEpochsInterval == 0)) { //Build progress report message string progressText = buildProgress.GetInfoText(leftMargin); //Report the progress _log.Write(progressText, !(buildProgress.NewEndNetwork)); } return; }