By deleting the gradients before calling the plotDiagnostics function, gradients are not shown in the diagnostics screen. This PR fixes the issue by freeing memory for the parameters only, but not their derivatives, if opts.plotDiagnostics is set to true.
By deleting the gradients before calling the plotDiagnostics function, gradients are not shown in the diagnostics screen. This PR fixes the issue by freeing memory for the parameters only, but not their derivatives, if opts.plotDiagnostics is set to true.