/** @copydoc LayerParameterBase::Clone */ public override LayerParameterBase Clone() { LSTMSimpleParameter p = new LSTMSimpleParameter(); p.Copy(this); return(p); }
/** @copydoc LayerParameterBase::Copy */ public override void Copy(LayerParameterBase src) { LSTMSimpleParameter p = (LSTMSimpleParameter)src; m_nNumOutput = p.m_nNumOutput; m_dfClippingThreshold = p.m_dfClippingThreshold; m_fillerWeights = p.m_fillerWeights.Clone(); m_fillerBias = p.m_fillerBias.Clone(); m_nBatchSize = p.m_nBatchSize; }
/** @copydoc LayerParameterBase::Load */ public override object Load(System.IO.BinaryReader br, bool bNewInstance = true) { RawProto proto = RawProto.Parse(br.ReadString()); LSTMSimpleParameter 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 LSTMSimpleParameter FromProto(RawProto rp) { string strVal; LSTMSimpleParameter p = new LSTMSimpleParameter(); if ((strVal = rp.FindValue("num_output")) != null) { p.num_output = uint.Parse(strVal); } if ((strVal = rp.FindValue("clipping_threshold")) != null) { p.clipping_threshold = double.Parse(strVal); } RawProto rpWeightFiller = rp.FindChild("weight_filler"); if (rpWeightFiller != null) { p.weight_filler = FillerParameter.FromProto(rpWeightFiller); } RawProto rpBiasFiller = rp.FindChild("bias_filler"); if (rpBiasFiller != null) { p.bias_filler = FillerParameter.FromProto(rpBiasFiller); } if ((strVal = rp.FindValue("batch_size")) != null) { p.batch_size = uint.Parse(strVal); } if ((strVal = rp.FindValue("enable_clockwork_forgetgate_bias")) != null) { p.enable_clockwork_forgetgate_bias = bool.Parse(strVal); } return(p); }