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

📄 demogng.java

📁 关于自组织神经网络的一种新结构程序,并包含了其它几种神经网络的程序比较
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
  /**   * The array for the number of runs to insert a new node.   *  To add or delete values to the choice, only this array must be changed.   */  protected int newNodeGNG_Ai[] = {600, 10, 50, 100, 200, 300,								   400, 500, 800, 1000, 2000};  /**   * The array for the value epsiolon initial of the HCL algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsiloniHCL_Af[] = {0.1f, 0.05f, 0.2f, 0.3f, 0.4f, 0.5f,									  0.6f, 0.7f, 0.8f, 0.9f, 1.0f};  /**   * The array for the value epsiolon final of the HCL algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsilonfHCL_Af[] = {0.005f, 0.0001f, 0.001f, 0.008f, 0.01f,									  0.05f, 0.1f, 0.2f, 0.5f, 1.0f};  /**   * The array for the value t_max of the HCL algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float tmaxHCL_Af[] = {20000, 1000, 5000, 10000, 30000, 40000};  /**   * The array for the value epsilon of the HCL algorithm.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsilonHCL_Af[] = {0.1f, 0.05f, 0.2f, 0.3f, 0.4f, 0.5f,								 0.6f, 0.7f, 0.8f, 0.9f, 1.0f};  /**   * The array for the value epsilon of the GNG algorithm (winner).   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsilonGNG1_Af[] = {0.05f, 0.0f, 0.001f, 0.005f, 0.01f,								  0.1f, 0.2f, 0.5f, 1.0f};  /**   * The array for the value epsilon of the GNG algorithm (second).   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsilonGNG2_Af[] = {0.0006f, 0.0f, 0.0001f, 0.001f, 0.005f,									  0.01f, 0.05f, 0.1f, 0.15f, 0.2f};  /**   * The array for the value alpha of the GNG algorithm.   *  To add or delete values to the choice, only this array must be changed.   */  protected float alphaGNG_Af[] = {0.5f, 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f};  /**   * The array for the value beta of the GNG algorithm.   *  To add or delete values to the choice, only this array must be changed.   */  protected float betaGNG_Af[] = {0.0005f, 0.0f, 0.00001f, 0.00005f, 0.0001f,								  0.001f, 0.005f, 0.01f, 0.05f, 0.1f, 0.5f,								  1.0f};  /**   * The array for the utility factor of the GNG-U algorithm.   *  To add or delete values to the choice, only this array must be changed.   */  protected float utilityGNG_Af[] =  {3.0f, 1.0f, 1.5f, 2.0f, 2.5f,									  3.5f, 4.0f, 4.5f, 5.0f, 5.5f, 6.0f, 6.5f,									  7.0f, 7.5f, 8.0f};  /**   * The array for the value lambda initial of the NG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float lambdaiNG_Af[] = {30, 10, 20, 40, 60, 80, 100};  /**   * The array for the value lambda final of the NG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float lambdafNG_Af[] = {0.01f, 0.0f, 0.001f, 0.005f, 0.05f,									0.1f, 0.2f, 0.5f, 1.0f};  /**   * The array for the value epsiolon initial of the NG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsiloniNG_Af[] = {0.3f, 0.1f, 0.2f, 0.4f, 0.5f, 0.6f,									 0.7f, 0.8f, 0.9f, 1.0f};  /**   * The array for the value epsiolon final of the NG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsilonfNG_Af[] = {0.05f, 0.0f, 0.001f, 0.005f, 0.01f,									 0.05f, 0.1f, 0.2f, 0.5f, 1.0f};  /**   * The array for the value t_max of the NG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float tmaxNG_Af[] = {40000, 1000, 5000, 10000, 20000, 30000};  /**   * The array for the value lambda initial of the NGwCHL algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float lambdaiCHL_Af[] = {30, 10, 20, 40, 60, 80, 100};  /**   * The array for the value lambda final of the NGwCHL algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float lambdafCHL_Af[] = {0.01f, 0.0f, 0.001f, 0.005f, 0.05f,									 0.1f, 0.2f, 0.5f, 1.0f};  /**   * The array for the value epsiolon initial of the NGwCHL algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsiloniCHL_Af[] ={0.3f, 0.1f, 0.2f, 0.4f, 0.5f, 0.6f, 0.7f,									 0.8f, 0.9f, 1.0f};  /**   * The array for the value epsiolon final of the NGwCHL algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsilonfCHL_Af[] = {0.05f, 0.0f, 0.001f, 0.005f, 0.01f,									  0.05f, 0.1f, 0.2f, 0.5f, 1.0f};  /**   * The array for the value t_max of the NGwCHL algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float tmaxCHL_Af[] = {40000, 1000, 5000, 10000, 20000, 30000};  /**   * The array for the value delete edge initial of the NGwCHL algorithm.   *  To add or delete values to the choice, only this array must be changed.   */  protected int edgeiCHL_Ai[] = {20, 10, 30, 40, 50, 60, 70, 80, 90, 100};  /**   * The array for the value delete edge final of the NGwCHL algorithm.   *  To add or delete values to the choice, only this array must be changed.   */  protected int edgefCHL_Ai[] = {200, 100, 120, 140, 180, 250, 300, 400, 500};  /**   * The array for the number of discrete signals.   *  To add or delete values to the choice, only this array must be changed.   */  protected int discreteNumSignalsLBG_Ai[] = {500, 3, 6, 9, 12, 15, 18,											  30, 60, 90, 100,											  120, 150, 180, 200, 210,											  240, 270, 300, 330, 360,											  390, 400, 420, 450, 480};  /**   * The array for the value lambda growing of the GG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float lambdagGG_Af[] = {30, 10, 20, 40, 60, 80, 100};  /**   * The array for the value lambda fine tuning of the GG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float lambdafGG_Af[] = {100, 60, 120, 150, 200};  /**   * The array for the value epsiolon initial of the GG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsiloniGG_Af[] = {0.1f, 0.05f, 0.2f, 0.3f, 0.4f, 0.5f,									 0.6f, 0.7f, 0.8f, 0.9f, 1.0f};  /**   * The array for the value epsiolon final of the GG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsilonfGG_Af[] = {0.005f, 0.0001f, 0.001f, 0.008f, 0.01f,									 0.05f, 0.1f, 0.2f, 0.5f, 1.0f};  /**   * The array for the value sigma of the GG algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float sigmaGG_Af[] = {0.9f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f,								  0.6f, 0.7f, 0.8f, 1.0f, 1.2f, 1.4f,								  1.6f, 1.8f, 2.0f};  /**   * The array for the value epsiolon initial of the SOM algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsiloniSOM_Af[] = {0.1f, 0.05f, 0.2f, 0.3f, 0.4f, 0.5f,									  0.6f, 0.7f, 0.8f, 0.9f, 1.0f};  /**   * The array for the value epsiolon final of the SOM algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float epsilonfSOM_Af[] = {0.005f, 0.0001f, 0.001f, 0.008f, 0.01f,									  0.05f, 0.1f, 0.2f, 0.5f, 1.0f};  /**   * The array for the value sigma of the SOM algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float sigmaiSOM_Af[] = {5.0f, 1.0f, 1.5f, 2.0f, 2.5f, 3.0f,									3.5f, 4.0f, 4.5f, 5.5f, 6.0f, 6.5f,									7.0f, 7.5f, 8.0f};  /**   * The array for the value sigma of the SOM algorithms.   *  To add or delete values to the choice, only this array must be changed.   */  protected float sigmafSOM_Af[] = {0.2f, 0.01f, 0.05f, 0.1f, 0.3f, 0.4f,									0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f};  /**   * The array for the value t_max of the SOM algorithm.   *  To add or delete values to the choice, only this array must be changed.   */  protected float tmaxSOM_Af[] = {40000, 1000, 5000, 10000, 20000, 30000};  /**   * The array for the grid size of the SOM algorithm.   *  To add or delete values to the choice, change this array and   *  sizeSOM_As[].   */  protected int sizeSOM_Ai[][] = {{10, 10}, {5, 5}, {30, 1}, {10, 5}, {5, 10},								  {30, 2}, {30, 3}, {30, 4},								  {15, 10}, {10, 15}, {20, 10}, {10, 20},								  {15, 15}, {19, 13}, {13, 19}};  /**   * The array for the grid size of the SOM algorithm.   *  To add or delete values to the choice, change this array and sizeSOM_Ai.   */  protected String sizeSOM_As[] = {"10x10", "5x5", "1x30", "5x10", "10x5",								   "2x30", "3x30", "4x30",								   "10x15", "15x10", "10x20", "20x10",								   "15x15", "13x19", "19x13"};  public void init() {	int i;    Font font = getFont();    Font boldFont = new Font(font.getName(), Font.BOLD, font.getSize());    // Set the layout-style    setLayout(new BorderLayout());    // Create the GNG-Panel and center it    compute = new ComputeGNG(this);    add("Center", compute);    // Create a Panel for the Buttons    // Put the Choice in a Panel to get a nicer look.    Panel cp_distrib = new Panel();    Panel cp_stepSize = new Panel();    Panel cp_speed = new Panel();    Panel cp_nodes = new Panel();    Panel cp_algo = new Panel();    // Create a menu of algorithms and add it to the Panel.    algo_choice = new Choice();    algo_choice.setFont(boldFont);    algo_choice.addItem(ALGO_5);    algo_choice.addItem(ALGO_1);    algo_choice.addItem(ALGO_2);    algo_choice.addItem(ALGO_4);    algo_choice.addItem(ALGO_3);    algo_choice.addItem(ALGO_0);    algo_choice.addItem(ALGO_7);    algo_choice.addItem(ALGO_6);    cp_algo.add(new Label("Network Model:", Label.RIGHT));    cp_algo.add(algo_choice);    add("North", cp_algo);    // Create new panel, set the layout-style and add it to the Panel    Panel pSouth = new Panel();    pSouth.setLayout(new BorderLayout());    add("South", pSouth);    Panel pAll = new Panel();	pAll.setLayout(new BorderLayout());    Panel pAllN = new Panel();    Panel pAllS = new Panel();    start_b = new Button(BUTTON_0);    stop_b = new Button(BUTTON_1);    restart_b = new Button(BUTTON_3);    start_b.disable();    restart_b.disable();    pAllN.add(start_b);    pAllN.add(stop_b);    pAllN.add(restart_b);    pAllN.add(new Checkbox(TEACH));    pAllN.add(new Checkbox(SIGNALS));    pAllN.add(new Checkbox(VORONOI));    pAllN.add(new Checkbox(DELAUNAY));	errorGraph_cb = new Checkbox(ERRORGRAPH, null, compute.errorGraphB);    pAllS.add(errorGraph_cb);    pAllS.add(new Checkbox(NODES, null, compute.nodesB));    pAllS.add(new Checkbox(EDGES, null, compute.edgesB));    pAllS.add(new Checkbox(RNDINIT, null, compute.rndInitB));    pAllS.add(new Checkbox(WHITE, null, compute.whiteB));    pAllS.add(new Checkbox(SOUND, null, compute.soundB));    pAll.add("North", pAllN);    pAll.add("South", pAllS);    pSouth.add("North", pAll);    Panel pDS = new Panel();    // Create a menu of distributions and add it to the Panel.    distrib_choice = new Choice();    distrib_choice.addItem(DISTRIB_0);    distrib_choice.addItem(DISTRIB_1);    distrib_choice.addItem(DISTRIB_2);    distrib_choice.addItem(DISTRIB_3);    distrib_choice.addItem(DISTRIB_4);    distrib_choice.addItem(DISTRIB_5);    distrib_choice.addItem(DISTRIB_6);    distrib_choice.addItem(DISTRIB_7);    distrib_choice.addItem(DISTRIB_8);    distrib_choice.addItem(DISTRIB_9);    distrib_choice.addItem(DISTRIB_10);    distrib_choice.addItem(DISTRIB_11);    distrib_choice.addItem(DISTRIB_12);    cp_distrib.add(new Label("prob. Distrib.:", Label.RIGHT));    cp_distrib.add(distrib_choice);    pDS.add(cp_distrib);    // Create a menu of node-numbers and add it to the Panel.    nodes_choice = new Choice();    for (i = 0; i < nodes_Ai.length; i++)      nodes_choice.addItem(String.valueOf(nodes_Ai[i]));    nodes_lbl = new Label("max. Nodes:", Label.RIGHT);    cp_nodes.add(nodes_lbl);    cp_nodes.add(nodes_choice);    pDS.add(cp_nodes);    // Create a menu of step sizes and add it to the Panel.    stepSize_choice = new Choice();    for (i = 0; i < stepSize_Ai.length; i++)      stepSize_choice.addItem(String.valueOf(stepSize_Ai[i]));    cp_stepSize.add(new Label("Display:", Label.RIGHT));    cp_stepSize.add(stepSize_choice);    pDS.add(cp_stepSize);    pSouth.add("Center", pDS);    // Create a menu of machine speeds and add it to the Panel.    speed_choice = new Choice();    for (i = 0; i < speed_As.length; i++)      speed_choice.addItem(speed_As[i]);    cp_speed.add(new Label("Speed:", Label.RIGHT));    cp_speed.add(speed_choice);    pDS.add(cp_speed);    pSouth.add("Center", pDS);    cards = new Panel();    cards.setLayout(new CardLayout());            Panel p1 = new Panel();    p1.setLayout(new BorderLayout());    Panel p10 = new Panel();    noNodes_cb = new Checkbox(NO_NEW_NODES);    p10.add(noNodes_cb);    utilityGNG_cb = new Checkbox(UTILITY_GNG, null, compute.utilityGNGB);    p10.add(utilityGNG_cb);    utilityGNG_choice = new Choice();    for (i = 0; i < utilityGNG_Af.length; i++)      utilityGNG_choice.addItem(String.valueOf(utilityGNG_Af[i]));    p10.add(utilityGNG_choice);    p11 = new Panel();    p11.setLayout(new GridLayout(2,6));    newNodeGNG_choice = new Choice();    for (i = 0; i < newNodeGNG_Ai.length; i++)      newNodeGNG_choice.addItem(String.valueOf(newNodeGNG_Ai[i]));    delEdgeGNG_choice = new Choice();    for (i = 0; i < delEdgeGNG_Ai.length; i++)      delEdgeGNG_choice.addItem(String.valueOf(delEdgeGNG_Ai[i]));    epsilonGNG1_choice = new Choice();

⌨️ 快捷键说明

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