Esempio n. 1
0
        /** @copydoc LayerParameterBase::Clone */
        public override LayerParameterBase Clone()
        {
            TVLossParameter p = new TVLossParameter();

            p.Copy(this);
            return(p);
        }
Esempio n. 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 TVLossParameter FromProto(RawProto rp)
        {
            string          strVal;
            TVLossParameter p = new TVLossParameter();

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

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

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

            return(p);
        }
Esempio n. 4
0
        /** @copydoc LayerParameterBase::Copy */
        public override void Copy(LayerParameterBase src)
        {
            TVLossParameter p = (TVLossParameter)src;

            m_fBeta = p.m_fBeta;
        }