Esempio n. 1
0
        /// <inheritdoc />
        public override void ResolveInputs()
        {
            name = Name.AsString();

            inputActivationFunction = Util.GetActivationFunction(InputActivationFunction.AsString("LINEAR"));

            inputHasBias = InputHasBias.AsBoolean(true);

            hiddenLayerConfig = HiddenLayerConfig.As2DArray <object>();

            outputActivationFunction = Util.GetActivationFunction(OutputActivationFunction.AsString("LINEAR"));

            outputHasBias = OutputHasBias.AsBoolean(true);

            inputs = Inputs.As2DArray <double>();

            targets = Targets.As2DArray <double>();

            errorTolerance = ErrorTolerance.AsDouble();

            epochLimit = EpochLimit.AsInt();
        }
            public override _SubDevice Extend()
            {
                UInt64?Den;

                if (BytesTotalPersec.AsString() != null)
                {
                    Den = BytesTotalPersec.AsUInt64() / 100;

                    if (Den != 0)
                    {
                        UInt64?percentBytesReceived = BytesReceivedPersec.AsString() != null?BytesReceivedPersec.AsUInt64() / Den : null;

                        PercentBytesReceived = new MobProperty(percentBytesReceived);
                        UInt64?percentBytesSent = BytesSentPersec.AsString() != null?BytesSentPersec.AsUInt64() / Den : null;

                        PercentBytesSent = new MobProperty(percentBytesSent);
                    }
                    else
                    {
                        PercentBytesReceived = new MobProperty("0");
                        PercentBytesSent     = new MobProperty("0");
                    }
                }
                else
                {
                    PercentBytesReceived = new MobProperty(null);
                    PercentBytesSent     = new MobProperty(null);
                }

                if (PacketsPersec.AsString() != null)
                {
                    Den = PacketsPersec.AsUInt64() / 100;
                    if (Den != 0)
                    {
                        UInt64?percentPacketsReceived = PacketsReceivedPersec.AsString() != null?PacketsReceivedPersec.AsUInt64() / Den : null;

                        PercentPacketsReceived = new MobProperty(percentPacketsReceived);
                        UInt64?percentPacketsSents = PacketsSentPersec.AsString() != null?PacketsSentPersec.AsUInt64() / Den : null;

                        PercentPacketsSents = new MobProperty(percentPacketsSents);
                    }
                    else
                    {
                        PercentPacketsSents    = new MobProperty("0");
                        PercentPacketsReceived = new MobProperty("0");
                    }
                }
                else
                {
                    PercentPacketsReceived = new MobProperty(null);
                    PercentPacketsSents    = new MobProperty(null);
                }

                var mjx = new WprManagementObjectSearcher("Win32_PerfRawData_Tcpip_NetworkAdapter").First(x => x.GetProperty("Name").AsString().Equals(Name.AsString())) ?? new WprManagementObject();

                TotalBytesReceived = mjx.GetProperty("BytesReceivedPersec");
                TotalBytesSent     = mjx.GetProperty("BytesSentPersec");
                TotalBytes         = mjx.GetProperty("BytesTotalPersec");

                return(this);
            }