/// <summary>
 /// The SigmoidCrossEntropyLayer constructor.
 /// </summary>
 /// <param name="cuda">Specifies the CudaDnn connection to Cuda.</param>
 /// <param name="log">Specifies the Log for output.</param>
 /// <param name="p">Specifies the LayerParameter of type SIGMOIDCROSSENTROPY_LOSS.
 /// </param>
 public SigmoidCrossEntropyLossLayer(CudaDnn <T> cuda, Log log, LayerParameter p)
     : base(cuda, log, p)
 {
     m_type = LayerParameter.LayerType.SIGMOIDCROSSENTROPY_LOSS;
     m_blobSigmoidOutput = new Blob <T>(cuda, log);
     m_sigmoidLayer      = new SigmoidLayer <T>(cuda, log, p);
 }
        /// <summary>
        /// The SigmoidCrossEntropyLayer constructor.
        /// </summary>
        /// <param name="cuda">Specifies the CudaDnn connection to Cuda.</param>
        /// <param name="log">Specifies the Log for output.</param>
        /// <param name="p">Specifies the LayerParameter of type SIGMOIDCROSSENTROPY_LOSS.
        /// </param>
        public SigmoidCrossEntropyLossLayer(CudaDnn <T> cuda, Log log, LayerParameter p)
            : base(cuda, log, p)
        {
            m_type = LayerParameter.LayerType.SIGMOIDCROSSENTROPY_LOSS;
            m_blobSigmoidOutput      = new Blob <T>(cuda, log);
            m_blobSigmoidOutput.Name = m_param.name + " sigmoid out";
            m_blobLoss      = new Blob <T>(cuda, log);
            m_blobLoss.Name = m_param.name + " loss";

            LayerParameter param_sigmoid = p.Clone(false);

            param_sigmoid.loss_weight.Clear();
            m_sigmoidLayer = new SigmoidLayer <T>(cuda, log, param_sigmoid);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// The SwishLayer constructor.
        /// </summary>
        /// <param name="cuda">Specifies the CudaDnn connection to Cuda.</param>
        /// <param name="log">Specifies the Log for output.</param>
        /// <param name="p">Specifies the LayerParameter of type Swish with parameter Swish_param,
        /// with options:
        ///     - beta (\b default 1) the value @f$ \beta @f$
        /// </param>
        public SwishLayer(CudaDnn <T> cuda, Log log, LayerParameter p)
            : base(cuda, log, p)
        {
            m_type = LayerParameter.LayerType.SWISH;

            m_blobSigmoidInput  = new Blob <T>(cuda, log);
            m_blobSigmoidOutput = new Blob <T>(cuda, log);

            LayerParameter sigmoidParam = new LayerParameter(LayerParameter.LayerType.SIGMOID);

            sigmoidParam.sigmoid_param.engine = p.swish_param.engine;

            m_sigmoidLayer = new SigmoidLayer <T>(cuda, log, sigmoidParam);
        }