示例#1
0
        /** @copydoc LayerParameterBase::ToProto */
        public override RawProto ToProto(string strName)
        {
            RawProtoCollection rgChildren = new RawProtoCollection();

            rgChildren.Add("num_output", m_nNumOutput.ToString());

            if (m_dfClippingThreshold != 0)
            {
                rgChildren.Add("clipping_threshold", m_dfClippingThreshold.ToString());
            }

            rgChildren.Add(m_fillerWeights.ToProto("weight_filler"));
            rgChildren.Add(m_fillerBias.ToProto("bias_filler"));

            if (m_nBatchSize != 1)
            {
                rgChildren.Add("batch_size", m_nBatchSize.ToString());
            }

            if (m_bEnableClockworkForgetGateBias != false)
            {
                rgChildren.Add("enable_clockwork_forgetgate_bias", m_bEnableClockworkForgetGateBias.ToString());
            }

            return(new RawProto(strName, "", rgChildren));
        }
示例#2
0
        /** @copydoc KernelParameter::ToProto */
        public override RawProto ToProto(string strName)
        {
            RawProto           rpBase     = base.ToProto("kernel");
            RawProtoCollection rgChildren = new RawProtoCollection();

            rgChildren.Add(rpBase.Children);
            rgChildren.Add("num_output", num_output.ToString());

            if (bias_term != true)
            {
                rgChildren.Add("bias_term", bias_term.ToString());
            }

            if (group != 1)
            {
                rgChildren.Add("group", group.ToString());
            }

            if (m_fillerParam_weights != null)
            {
                rgChildren.Add(m_fillerParam_weights.ToProto("weight_filler"));
            }

            if (bias_term && m_fillerParam_bias != null)
            {
                rgChildren.Add(m_fillerParam_bias.ToProto("bias_filler"));
            }

            if (axis != 1)
            {
                rgChildren.Add("axis", axis.ToString());
            }

            if (force_nd_im2col != false)
            {
                rgChildren.Add("force_nd_im2col", force_nd_im2col.ToString());
            }

            if (cudnn_workspace_limit != (1024 * 1024))
            {
                rgChildren.Add("cudnn_workspace_limit", cudnn_workspace_limit.ToString());
            }

            if (cudnn_workspace_allow_on_groups)
            {
                rgChildren.Add("cudnn_worspace_allow_on_groups", cudnn_workspace_allow_on_groups.ToString());
            }

            if (cudnn_enable_tensor_cores)
            {
                rgChildren.Add("cudnn_enable_tensor_cores", cudnn_enable_tensor_cores.ToString());
            }

            return(new RawProto(strName, "", rgChildren));
        }
示例#3
0
        /** @copydoc LayerParameterBase::ToProto */
        public override RawProto ToProto(string strName)
        {
            RawProtoCollection rgChildren = new RawProtoCollection();

            if (m_filler != null)
            {
                rgChildren.Add(m_filler.ToProto("filler"));
            }

            if (channel_shared != false)
            {
                rgChildren.Add("channel_shared", channel_shared.ToString());
            }

            return(new RawProto(strName, "", rgChildren));
        }
        /// <summary>
        /// Convert the parameter into a RawProto.
        /// </summary>
        /// <param name="strName">Specifies the name to associate with the RawProto.</param>
        /// <returns>The new RawProto is returned.</returns>
        public override RawProto ToProto(string strName)
        {
            RawProtoCollection rgChildren = new RawProtoCollection();

            if (axis != 1)
            {
                rgChildren.Add("axis", axis.ToString());
            }

            if (num_axes != 1)
            {
                rgChildren.Add("num_axes", num_axes.ToString());
            }

            if (m_filler != null)
            {
                rgChildren.Add(m_filler.ToProto("filler"));
            }

            return(new RawProto(strName, "", rgChildren));
        }