Пример #1
0
        public void AddLayer(Layers.LayerBase <T> layer)
        {
            var previousLayer = this.Layers.LastOrDefault();

            if (previousLayer != null)
            {
                layer.AcceptParent(previousLayer);
            }

            this.Layers.Add(layer);

            this.Op = this.Layers.Last().Op;

            if (layer is Layers.ILastLayer <T> lastLayer)
            {
                this.Cost = lastLayer.Cost;
                this.Session.Differentiate(this.Cost, Ops <T> .One);
            }
        }
Пример #2
0
 public override void AcceptParent(LayerBase <T> parent)
 {
     base.AcceptParent(parent);
     this.Op = ConvNetSharp <T> .Instance.Relu(parent.Op);
 }
 public override void AcceptParent(LayerBase <T> parent)
 {
     base.AcceptParent(parent);
     this.Op = parent.Op.Graph.Tanh(parent.Op);
 }