You are here

Runtime exception: IndexOutOfRangeException for Chapter08PruneSelective

I'm getting the following runtime exception when trying to run Chapter08PruneSelective. All prior chapter projects (so far - Chapter03App thru Chapter08PruneIncremental) have built and run fine for me. Am I doing something wrong?

Here's the exception:


System.IndexOutOfRangeException was unhandled
Message=Index was outside the bounds of the array.
Source=HeatonResearchNeural
StackTrace:
at HeatonResearchNeural.Matrix.Matrix.GetCol(Int32 col) in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\HeatonResearchNeural\Matrix\Matrix.cs:line 251
at HeatonResearchNeural.Feedforward.FeedforwardLayer.ComputeOutputs(Double[] pattern) in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\HeatonResearchNeural\Feedforward\FeedforwardLayer.cs:line 202
at HeatonResearchNeural.Feedforward.FeedforwardNetwork.ComputeOutputs(Double[] input) in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\HeatonResearchNeural\Feedforward\FeedforwardNetwork.cs:line 237
at HeatonResearchNeural.Feedforward.FeedforwardNetwork.CalculateError(Double[][] input, Double[][] ideal) in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\HeatonResearchNeural\Feedforward\FeedforwardNetwork.cs:line 160
at HeatonResearchNeural.Prune.Prune.DetermineError(FeedforwardNetwork network) in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\HeatonResearchNeural\Prune\Prune.cs:line 214
at HeatonResearchNeural.Prune.Prune.FindNeuron() in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\HeatonResearchNeural\Prune\Prune.cs:line 230
at HeatonResearchNeural.Prune.Prune.PruneSelective() in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\HeatonResearchNeural\Prune\Prune.cs:line 316
at Chapter08PruneSelective.PruneSelectiveForm.btnPrune_Click(Object sender, EventArgs e) in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\Chapter08PruneSelective\PruneSelectivelForm.cs:line 146
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Chapter08PruneSelective.PruneSelective.Main() in D:\Users\JDFagan\Repositories\JDFagan\Heaton\IntroNeuralNetworks\Chapter08PruneSelective\PruneSelective.cs:line 15
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Neural Network Forums: 
SeemaSingh's picture

Hmmm I will have to try that. Based on the error, it sounds like it is trying to prune too much.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer