/// <summary> /// Initializes a new instance of the <see cref="RecurrentContext" /> class. Used by Serializer /// </summary> /// <param name='info'> /// Info. /// </param> /// <param name='context'> /// Context. /// </param> public RecurrentContext(SerializationInfo info, StreamingContext context) : base(info, context) { _SourceNodes = (List<Node.Base>) info.GetValue("_SourceNodes", typeof (List<Node.Base>)); _LevelOfContext = info.GetInt32("_LevelOfContext"); _ActivationFunction = (ActivationFunction.Base) info.GetValue("_ActivationFunction", typeof (ActivationFunction.Base)); }
/// <summary> /// Initializes a new instance of the /// <see> /// <cref>Cranium.Structure.Node.Base</cref> /// </see> /// class for use by the serializer. /// </summary> /// <param name='layer'> /// Layer. /// </param> /// <param name='activationFunction'> /// Activation function. /// </param> public Base(Layer.Base layer, ActivationFunction.Base activationFunction) { _ParentLayer = layer; _ActivationFunction = activationFunction; }
public virtual void Dispose() { _ParentLayer = null; _ForwardWeights.Clear(); _ForwardWeights = null; _ReverseWeights.Clear(); _ReverseWeights = null; _ActivationFunction.Dispose(); _ActivationFunction = null; }
/// <summary> /// Initializes a new instance of the /// <see> /// <cref>Cranium.Structure.Node.Base</cref> /// </see> /// class. Used by the Serializer /// </summary> /// <param name='info'> /// Info. /// </param> /// <param name='context'> /// Context. /// </param> public Base(SerializationInfo info, StreamingContext context) { _Value = info.GetDouble("_Value"); _Error = info.GetDouble("_Error"); _ParentLayer = (Layer.Base)info.GetValue("_ParentLayer", typeof(Layer.Base)); _ForwardWeights = (List<Weight.Base>)info.GetValue("_ForwardWeights", typeof(List<Weight.Base>)); _ReverseWeights = (List<Weight.Base>)info.GetValue("_ReverseWeights", typeof(List<Weight.Base>)); _ActivationFunction = (ActivationFunction.Base)info.GetValue("_ActivationFunction", typeof(ActivationFunction.Base)); _NodeID = info.GetInt32("_NodeID"); }
/// <summary> /// Initializes a new instance of the <see cref="RecurrentContext" /> class. /// </summary> /// <param name='levelOfContext'> /// Level of context. /// </param> /// <param name='activationFunction'> /// Activation function to be used for the context nodes. /// </param> public RecurrentContext(Int32 levelOfContext, ActivationFunction.Base activationFunction) { _ActivationFunction = activationFunction; _SourceNodes = new List<Node.Base>(); _LevelOfContext = levelOfContext; }
/// <summary> /// Initializes a new instance of the <see cref="EchoReservoir" /> class. /// </summary> /// <param name='nodeCount'> /// The number of nodes in the Reservoir /// </param> /// <param name='levelOfConnectivity'> /// The connectivity is calculated as chances = max-min, for each chance the levelOfConnectivity is compared to a /// random double, if levelOfConnectivity is higher /// then an additional connection is made ontop of the origional Min /// </param> /// <param name='minimumConnections'> /// Minimum connections per node. /// </param> /// <param name='maximumConnections'> /// Maximum connections per node. /// </param> /// <param name='activationFunction'> /// Activation function. /// </param> public EchoReservoir(Int32 nodeCount, Double levelOfConnectivity, Int32 minimumConnections, Int32 maximumConnections, ActivationFunction.Base activationFunction) { _NodeCount = nodeCount; _LevelOfConnectivity = levelOfConnectivity; _MinimumConnections = minimumConnections; _MaximumConnections = maximumConnections; _ActivationFunction = activationFunction; }
/// <summary> /// Initializes a new instance of the <see cref="EchoReservoir" /> class. Used by the Serialiszer /// </summary> /// <param name='info'> /// Info. /// </param> /// <param name='context'> /// Context. /// </param> public EchoReservoir(SerializationInfo info, StreamingContext context) : base(info, context) { _NodeCount = info.GetInt32("_NodeCount"); _LevelOfConnectivity = info.GetDouble("_LevelOfConnectivity"); _MinimumConnections = info.GetInt32("_MinimumConnections"); _MaximumConnections = info.GetInt32("_MaximumConnections"); _ActivationFunction = (ActivationFunction.Base) info.GetValue("_ActivationFunction", typeof (ActivationFunction.Base)); _Rnd = (Random) info.GetValue("_Rnd", typeof (Random)); }