Esempio n. 1
0
        public void Start()
        {
            LoadingStarted(this, new EventArgs());

            MultiActivationNetwork multiNetwork = new MultiActivationNetwork(TargetProcessName);

            IList<HistorySnapshot> snapshots = LoadSnapshots(SourceSnapshots);
            snapshots = Shuffle(snapshots);
            LoadingFinished(this, new EventArgs());

            LearningSet learningSet = new LearningSet(snapshots, TargetProcessName);

            TrainLearningSet(multiNetwork, learningSet.Learning);
            INetworkTrustRegistry trustRegistry = CheckLearningSet(multiNetwork, learningSet.Checking);
            multiNetwork.TrustVector = trustRegistry;
            Log.Info("Applied trust vector: " + trustRegistry.ToString());
            TrainLearningSet(multiNetwork, learningSet.Checking);
            CheckLearningSet(multiNetwork, learningSet.Testing);
        }
Esempio n. 2
0
 public Agent(string name, ISet<IPID> native, ISet<IPID> foreign)
 {
     m_Name = name;
     m_Analyzer = new MultiActivationNetwork(name);
     foreach (IPID pid in native)
     {
         if (!m_NativePIDs.Contains(pid.PID))
         {
             m_NativePIDs.Add(pid.PID);
         }
     }
     foreach (IPID pid in foreign)
     {
         if (!m_ForeignPIDs.Contains(pid.PID))
         {
             m_ForeignPIDs.Add(pid.PID);
         }
     }
 }
Esempio n. 3
0
 private INetworkTrustRegistry CheckLearningSet(MultiActivationNetwork multiNetwork, IList<HistorySnapshot> checkingSet)
 {
     ComputationStarted(this, new EventArgs());
     IList<KeyValuePair<IMultiNetworkComputationResult, bool>> yesList =
         new List<KeyValuePair<IMultiNetworkComputationResult, bool>>();
     int i = 0;
     INetworkTrustRegistry trustRegistry = new NetworkTrustVector();
     foreach (HistorySnapshot snapshot in checkingSet)
     {
         bool expectedYes = snapshot.LegacyProcessName.Contains(TargetProcessName);
         IMultiNetworkComputationResult result = multiNetwork.Compute(snapshot);
         ResultObtained(this, new ProgressEventArgs(++i, checkingSet.Count));
         trustRegistry.ApplyTrustLevel(result.Results, expectedYes ? 0 : 1);
         yesList.Add(new KeyValuePair<IMultiNetworkComputationResult, bool>(result, expectedYes));
     }
     ComputationFinished(this, new ComputationFinishedEventArgs(yesList));
     return trustRegistry;
 }
Esempio n. 4
0
 private void TrainLearningSet(MultiActivationNetwork multiNetwork, IList<HistorySnapshot> learningSet)
 {
     int i = 0;
     TrainingStarted(this, new EventArgs());
     //learningSet = RemoveDuplicates(learningSet);
     learningSet = Shuffle(learningSet);
     foreach (HistorySnapshot snapshot in learningSet)
     {
         bool isTargetProcess = snapshot.LegacyProcessName.Contains(multiNetwork.TargetProcessName);
         multiNetwork.RunTrain(snapshot, isTargetProcess);
         Trained(this, new ProgressEventArgs(++i, learningSet.Count));
     }
     TrainingFinished(this, new EventArgs());
 }