Example #1
0
        /** @copydoc LayerParameterBase::Clone */
        public override LayerParameterBase Clone()
        {
            ThresholdParameter p = new ThresholdParameter();

            p.Copy(this);
            return(p);
        }
Example #2
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 ThresholdParameter FromProto(RawProto rp)
        {
            string             strVal;
            ThresholdParameter p = new ThresholdParameter();

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

            return(p);
        }
Example #3
0
        /** @copydoc LayerParameterBase::Load */
        public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
        {
            RawProto           proto = RawProto.Parse(br.ReadString());
            ThresholdParameter p     = FromProto(proto);

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

            return(p);
        }
Example #4
0
        /** @copydoc LayerParameterBase::Copy */
        public override void Copy(LayerParameterBase src)
        {
            ThresholdParameter p = (ThresholdParameter)src;

            m_dfThreshold = p.m_dfThreshold;
        }