示例#1
0
        private void btnPrune_Click(object sender, EventArgs e)
        {

            Prune prune = new Prune(this.network, PruneSelectiveForm.XOR_INPUT, this.obtainIdeal(), 0.05);
            int count = prune.PruneSelective();
            this.network = prune.CurrentNetwork;
            this.SetText("Prune removed " + count + " neurons.");

        }
        public void ThreadProc()
        {
		int update = 0;

        Prune prune = new Prune(0.7, 0.5, PruneIncrementalForm.XOR_INPUT, this.obtainIdeal(), 0.05);
		prune.StartIncremental();

		while (!prune.Done) {
			prune.PruneIncramental();
			update++;
			if (update == 10) {
				this.SetText( "Cycles:" + prune.Cycles
						+ ",Hidden Neurons:" + prune.HiddenNeuronCount
						+ ", Current Error=" + prune.Error);
				update = 0;
			}
		}

		this.SetText( "Best network found:" + prune.HiddenNeuronCount
						+ ",error = " + prune.Error);
		this.network = prune.CurrentNetwork;
		//this.btnRun.Enabled = true;
        }