⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo.cs

📁 难得一见的C#神经网络建模
💻 CS
📖 第 1 页 / 共 2 页
字号:
			// 
			this.tabPage2.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
			this.tabPage2.Controls.AddRange(new System.Windows.Forms.Control[] {
																				   this.num_res,
																				   this.label3,
																				   this.panel4,
																				   this.b_3d_drawnn,
																				   this.label2,
																				   this.b_3d_clearnn,
																				   this.b_3d_learn,
																				   this.panel3,
																				   this.b_3d_cpts});
			this.tabPage2.Location = new System.Drawing.Point(4, 28);
			this.tabPage2.Name = "tabPage2";
			this.tabPage2.Size = new System.Drawing.Size(984, 576);
			this.tabPage2.TabIndex = 1;
			this.tabPage2.Text = "Repartition Aproximation";
			// 
			// num_res
			// 
			this.num_res.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.num_res.DecimalPlaces = 3;
			this.num_res.Increment = new System.Decimal(new int[] {
																	  5,
																	  0,
																	  0,
																	  196608});
			this.num_res.Location = new System.Drawing.Point(192, 528);
			this.num_res.Maximum = new System.Decimal(new int[] {
																	5,
																	0,
																	0,
																	65536});
			this.num_res.Minimum = new System.Decimal(new int[] {
																	5,
																	0,
																	0,
																	196608});
			this.num_res.Name = "num_res";
			this.num_res.Size = new System.Drawing.Size(88, 23);
			this.num_res.TabIndex = 17;
			this.num_res.Value = new System.Decimal(new int[] {
																  25,
																  0,
																  0,
																  196608});
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(104, 530);
			this.label3.Name = "label3";
			this.label3.TabIndex = 16;
			this.label3.Text = "Resolution :";
			// 
			// panel4
			// 
			this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.panel4.Controls.AddRange(new System.Windows.Forms.Control[] {
																				 this.demo3D_draw1});
			this.panel4.Location = new System.Drawing.Point(16, 72);
			this.panel4.Name = "panel4";
			this.panel4.Size = new System.Drawing.Size(600, 400);
			this.panel4.TabIndex = 15;
			// 
			// demo3D_draw1
			// 
			this.demo3D_draw1.BackColor = System.Drawing.Color.White;
			this.demo3D_draw1.Name = "demo3D_draw1";
			this.demo3D_draw1.Resolution = 0.025F;
			this.demo3D_draw1.Size = new System.Drawing.Size(600, 400);
			this.demo3D_draw1.TabIndex = 14;
			// 
			// b_3d_drawnn
			// 
			this.b_3d_drawnn.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
			this.b_3d_drawnn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.b_3d_drawnn.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.b_3d_drawnn.Location = new System.Drawing.Point(304, 528);
			this.b_3d_drawnn.Name = "b_3d_drawnn";
			this.b_3d_drawnn.Size = new System.Drawing.Size(240, 23);
			this.b_3d_drawnn.TabIndex = 11;
			this.b_3d_drawnn.Text = "Draw neural network output";
			this.b_3d_drawnn.Click += new System.EventHandler(this.b_3d_drawnn_Click);
			// 
			// label2
			// 
			this.label2.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label2.Location = new System.Drawing.Point(16, 24);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(608, 32);
			this.label2.TabIndex = 13;
			this.label2.Text = "Demo of repartition aproximation by a neural network";
			// 
			// b_3d_clearnn
			// 
			this.b_3d_clearnn.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
			this.b_3d_clearnn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.b_3d_clearnn.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.b_3d_clearnn.Location = new System.Drawing.Point(336, 488);
			this.b_3d_clearnn.Name = "b_3d_clearnn";
			this.b_3d_clearnn.Size = new System.Drawing.Size(240, 23);
			this.b_3d_clearnn.TabIndex = 9;
			this.b_3d_clearnn.Text = "Clear neural network output";
			this.b_3d_clearnn.Click += new System.EventHandler(this.b_3d_clearnn_Click);
			// 
			// b_3d_learn
			// 
			this.b_3d_learn.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(255)), ((System.Byte)(192)));
			this.b_3d_learn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.b_3d_learn.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.b_3d_learn.Location = new System.Drawing.Point(208, 488);
			this.b_3d_learn.Name = "b_3d_learn";
			this.b_3d_learn.Size = new System.Drawing.Size(104, 23);
			this.b_3d_learn.TabIndex = 10;
			this.b_3d_learn.Text = "Learn";
			this.b_3d_learn.Click += new System.EventHandler(this.b_3d_learn_Click);
			// 
			// panel3
			// 
			this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.panel3.Controls.AddRange(new System.Windows.Forms.Control[] {
																				 this.neuralNetworkEditor2});
			this.panel3.Location = new System.Drawing.Point(632, 8);
			this.panel3.Name = "panel3";
			this.panel3.Size = new System.Drawing.Size(336, 552);
			this.panel3.TabIndex = 12;
			// 
			// neuralNetworkEditor2
			// 
			this.neuralNetworkEditor2.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
			this.neuralNetworkEditor2.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.neuralNetworkEditor2.Name = "neuralNetworkEditor2";
			this.neuralNetworkEditor2.Neural_Network = null;
			this.neuralNetworkEditor2.Size = new System.Drawing.Size(336, 552);
			this.neuralNetworkEditor2.TabIndex = 5;
			// 
			// b_3d_cpts
			// 
			this.b_3d_cpts.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(192)), ((System.Byte)(192)));
			this.b_3d_cpts.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.b_3d_cpts.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.b_3d_cpts.Location = new System.Drawing.Point(56, 488);
			this.b_3d_cpts.Name = "b_3d_cpts";
			this.b_3d_cpts.Size = new System.Drawing.Size(136, 23);
			this.b_3d_cpts.TabIndex = 8;
			this.b_3d_cpts.Text = "Clear points";
			this.b_3d_cpts.Click += new System.EventHandler(this.b_3d_cpts_Click);
			// 
			// Demo
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(7, 16);
			this.ClientSize = new System.Drawing.Size(984, 598);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.tabControl1});
			this.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Name = "Demo";
			this.Text = "Neural Network Demo";
			this.Load += new System.EventHandler(this.Demo_Load);
			this.panel1.ResumeLayout(false);
			this.panel2.ResumeLayout(false);
			this.tabControl1.ResumeLayout(false);
			this.tabPage1.ResumeLayout(false);
			this.tabPage2.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.num_res)).EndInit();
			this.panel4.ResumeLayout(false);
			this.panel3.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Demo());
		}

		private void b_clear_pts_Click(object sender, System.EventArgs e)
		{
			demo2D_Draw1.clearPoints();
		}

		private void b_learn_Click(object sender, System.EventArgs e)
		{
			demo2D_Draw1.setNeuralNetwork(neuralNetworkEditor1.Neural_Network);
			demo2D_Draw1.learn();
			neuralNetworkEditor1.refreshAll();

		}

		private void b_clear_draw_Click(object sender, System.EventArgs e)
		{
			demo2D_Draw1.Refresh();
		}

		private void b_draw_out_Click(object sender, System.EventArgs e)
		{
			demo2D_Draw1.Refresh();
			demo2D_Draw1.setNeuralNetwork(neuralNetworkEditor1.Neural_Network);
			demo2D_Draw1.drawNNOut();
		}

		private void Demo_Load(object sender, System.EventArgs e)
		{
		
		}

		private void b_3d_drawnn_Click(object sender, System.EventArgs e)
		{
			demo3D_draw1.Refresh();
			demo3D_draw1.setNeuralNetwork(neuralNetworkEditor2.Neural_Network);
			demo3D_draw1.Resolution = (float)this.num_res.Value;
			demo3D_draw1.drawNNOut();
		}

		private void b_3d_cpts_Click(object sender, System.EventArgs e)
		{
			demo3D_draw1.clearPoints();
		}

		private void b_3d_clearnn_Click(object sender, System.EventArgs e)
		{
			demo3D_draw1.Refresh();
		}

		private void b_3d_learn_Click(object sender, System.EventArgs e)
		{
			demo3D_draw1.setNeuralNetwork(neuralNetworkEditor2.Neural_Network);
			demo3D_draw1.learn();
			neuralNetworkEditor2.refreshAll();
		}

		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -