示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LossLayer"/> class, using the existing <see cref="LossLayer"/> object.
 /// </summary>
 /// <param name="other">The <see cref="LossLayer"/> to copy the data from.</param>
 protected LossLayer(LossLayer other)
     : base(other)
 {
     this.NumberOfClasses = other.NumberOfClasses;
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LossLayer"/> class.
 /// </summary>
 /// <param name="shape">The shape of the layer's input tensor.</param>
 protected LossLayer(Shape shape)
     : base(1, LossLayer.CalculateOutputShape(shape))
 {
     this.NumberOfClasses = this.OutputShape.Axes.Skip(1).Aggregate(1, (total, next) => total * next);
 }