예제 #1
0
        /** @copydoc EngineParameter::Clone */
        public override LayerParameterBase Clone()
        {
            SwishParameter p = new SwishParameter();

            p.Copy(this);
            return(p);
        }
예제 #2
0
        /** @copydoc LayerParameterBase::Copy */
        public override void Copy(LayerParameterBase src)
        {
            base.Copy(src);

            if (src is SwishParameter)
            {
                SwishParameter p = (SwishParameter)src;
                m_dfBeta = p.m_dfBeta;
            }
        }
예제 #3
0
        /** @copydoc LayerParameterBase::Load */
        public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
        {
            RawProto       proto = RawProto.Parse(br.ReadString());
            SwishParameter p     = FromProto(proto);

            if (!bNewInstance)
            {
                Copy(p);
            }

            return(p);
        }
예제 #4
0
        /// <summary>
        /// Parses the parameter from a RawProto.
        /// </summary>
        /// <param name="rp">Specifies the RawProto to parse.</param>
        /// <returns>A new instance of the parameter is returned.</returns>
        public static new SwishParameter FromProto(RawProto rp)
        {
            string         strVal;
            SwishParameter p = new SwishParameter();

            p.Copy(EngineParameter.FromProto(rp));

            if ((strVal = rp.FindValue("beta")) != null)
            {
                p.beta = double.Parse(strVal);
            }

            return(p);
        }