Ejemplo n.º 1
0
        private void Forward(bool isTraining)
        {
            if (lastOp == Ops.Forward)
            {
                return;
            }

            InNodes.ForEach(N =>
            {
                if (N.lastOp != Ops.Forward)
                {
                    return;
                }
            });

            lastOp = Ops.Forward;

            Layers.ForEach(L => L.Forward(isTraining));
            OutNodes.ForEach(N => N.Forward(isTraining));
        }
Ejemplo n.º 2
0
        private void CalcGrads()
        {
            if (lastOp == Ops.CalcGrads)
            {
                return;
            }

            OutNodes.ForEach(N =>
            {
                if (N.lastOp != Ops.CalcGrads)
                {
                    return;
                }
            });

            lastOp = Ops.CalcGrads;

            for (int i = Length - 1; i >= 0; i--)
            {
                Layers[i].CalcGrads();
            }

            InNodes.ForEach(N => N.CalcGrads());
        }