/// <summary> /// Initializes a new instance of the <see cref="RecurrentContext" /> class. Used by the Serializer. /// </summary> /// <param name='info'> /// Info. /// </param> /// <param name='context'> /// Context. /// </param> public RecurrentContext(SerializationInfo info, StreamingContext context) : base(info, context) { _SourceNode = (Base) info.GetValue("_SourceNode", typeof (Base)); _RateOfUpdate = info.GetDouble("_RateOfUpdate"); _StartValue = info.GetDouble("_StartValue"); }
/// <summary> /// Initializes a new instance of the <see cref="RecurrentContext" /> class. /// </summary> /// <param name='sourceNode'> /// Source node. /// </param> /// <param name='rateOfUpdate'> /// Rate of update. /// </param> /// <param name='parentLayer'> /// Parent layer. /// </param> /// <param name='activationFunction'> /// Activation function. /// </param> public RecurrentContext(Base sourceNode, Double rateOfUpdate, Layer.Base parentLayer, ActivationFunction.Base activationFunction) : base(parentLayer, activationFunction) { _Value = 0.0f; _SourceNode = sourceNode; _RateOfUpdate = rateOfUpdate; }
/// <summary> /// Connects a second node to this one, building the correct weight and adding it to the list of weights that are /// updated when required /// </summary> /// <param name='nodeToConnect'> /// Node to connect. /// </param> /// <param name='connectionDirectionToNode'> /// Connection direction to node. /// </param> /// <param name='startingWeight'> /// Starting weight. /// </param> public override void ConnectToNode(Base nodeToConnect, Weight.Base.ConnectionDirection connectionDirectionToNode, Single startingWeight) { if (connectionDirectionToNode == Weight.Base.ConnectionDirection.REVERSE) return; base.ConnectToNode(nodeToConnect, connectionDirectionToNode, startingWeight); }
/// <summary> /// Connects a second node to this one, building the correct weight and adding it to the list of weights that are /// updated when required /// </summary> /// <param name='nodeToConnect'> /// Node to connect. /// </param> /// <param name='connectionDirectionToNode'> /// Connection direction to node. /// </param> /// <param name='startingWeight'> /// Starting weight. /// </param> public virtual void ConnectToNode(Base nodeToConnect, Weight.Base.ConnectionDirection connectionDirectionToNode, Single startingWeight) { Weight.Base theNewWeight; switch (connectionDirectionToNode) { case Weight.Base.ConnectionDirection.FORWARD: _TFowardWeights = null; theNewWeight = new Weight.Base(this, nodeToConnect, startingWeight); _ForwardWeights.Add(theNewWeight); nodeToConnect._ReverseWeights.Add(theNewWeight); break; case Weight.Base.ConnectionDirection.REVERSE: _TReverseWeights = null; theNewWeight = new Weight.Base(nodeToConnect, this, startingWeight); _ReverseWeights.Add(theNewWeight); nodeToConnect._ForwardWeights.Add(theNewWeight); break; } }