/** @copydoc LayerParameterBase::Copy */ public override void Copy(LayerParameterBase src) { TripletLossSimpleParameter p = (TripletLossSimpleParameter)src; m_dfAlpha = p.m_dfAlpha; m_nSeparate = p.m_nSeparate; }
/** @copydoc LayerParameterBase::Clone */ public override LayerParameterBase Clone() { TripletLossSimpleParameter p = new TripletLossSimpleParameter(); p.Copy(this); return(p); }
/** @copydoc LayerParameterBase::Load */ public override object Load(System.IO.BinaryReader br, bool bNewInstance = true) { RawProto proto = RawProto.Parse(br.ReadString()); TripletLossSimpleParameter p = FromProto(proto); if (!bNewInstance) { Copy(p); } return(p); }
/// <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 TripletLossSimpleParameter FromProto(RawProto rp) { string strVal; TripletLossSimpleParameter p = new TripletLossSimpleParameter(); if ((strVal = rp.FindValue("alpha")) != null) { p.alpha = double.Parse(strVal); } if ((strVal = rp.FindValue("separate")) != null) { p.separate = int.Parse(strVal); } return(p); }