Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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);
        }