C# でゼロから Deep Learning を実装する挑戦はまだ 4 章。 機械学習で使う勾配降下法を実装してみた。 勾配を計算するメソッドは前回記事を流用している。 using MathNet.Numerics.LinearAlgebra; using System; using System.Linq; namespace GradientDescentSample { class Program { static void Main(string[] args) { // f(x0, x1) = x0^2 + x1^2 Func<Vector<double>, double> function2 = (x) => Math.Pow(x[0], 2) + Math.Pow(x[1], 2); var initX = Vector<double>.Build.DenseOfArray(