public Dense(int units, IActivation activation, bool useBias = true, IInitialization weightInitializer = null, IInitialization biasInitializer = null) { LayerSize = units; _activation = activation; _weightInitializer = weightInitializer ?? Initializations.Zero(); _biasInitializer = biasInitializer ?? Initializations.Zero(); _useBias = useBias; }
public void TestZeroInitialization() { var initialization = Initializations.Zero(); var initializedMatrix = initialization.Initialize(2, 2); var expectedMatrix = Matrix <double> .Build.Dense(2, 2); Assert.AreEqual(initializedMatrix, expectedMatrix); }