霍普菲尔德神经网络

发布于 2024-07-22 12:05:36 字数 50 浏览 5 评论 0原文

你知道除了模式识别之外还有什么应用吗? 值得实施 Hopfield 神经网络模型吗?

do you know any application beside pattern recog. worthe in order to implement Hopfield neural network model?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

森罗 2024-07-29 12:05:36

循环神经网络(hopfield 网络是一种特殊类型)用于序列学习中的多种任务:

  • 序列预测(将股票值的历史映射到下一个时间步的期望值)
  • 序列分类(将每个完整的音频片段映射到说话者)
  • 序列标记(将音频片段映射到所说的句子)
  • 非马尔可夫强化学习(例如需要深度记忆作为 T 迷宫基准的任务)

我不确定“模式识别”到底是什么意思,因为它基本上是一个完整的领域,可以使用神经网络来完成每个任务。

Recurrent neural networks (of which hopfield nets are a special type) are used for several tasks in sequence learning:

  • Sequence Prediction (Map a history of stock values to the expected value in the next timestep)
  • Sequence classification (Map each complete audio snippet to a speaker)
  • Sequence labelling (Map an audio snippet to the sentence spoken)
  • Non-markovian reinforcement learning (e.g. tasks that require deep memory as the T-Maze benchmark)

I am not sure what you mean by "pattern recognition" exactly, since it basically is a whole field into which each task for which neural networks can be used fits.

狼性发作 2024-07-29 12:05:36

您也可以使用 Hopfield 网络来解决优化问题。

You can use Hopfield network for optimization problems as well.

一片旧的回忆 2024-07-29 12:05:36

您可以查看此存储库 --> Hopfield Network

这里有一个在离线训练网络后测试模式的示例。
这是测试

 @Test
 public void HopfieldTest(){
     double[] p1 = new double[]{1.0, -1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0};
     double[] p2 = new double[]{1.0, 1.0,1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0};
     double[] p3 = new double[]{1.0, 1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0};

     ArrayList<double[]> patterns = new ArrayList<>();
     patterns.add(p1);
     patterns.add(p2);

     Hopfield h = new Hopfield(9, new StepFunction());

     h.train(patterns); //train and load the Weight matrix

     double[] result = h.test(p3); //Test a pattern

     System.out.println("\nConnections of Network: " + h.connections() + "\n"); //show Neural connections
     System.out.println("Good recuperation capacity of samples: " + Hopfield.goodRecuperation(h.getWeights().length) + "\n");
     System.out.println("Perfect recuperation capacity of samples: " + Hopfield.perfectRacuperation(h.getWeights().length) + "\n");
     System.out.println("Energy: " + h.energy(result));

     System.out.println("Weight Matrix");
     Matrix.showMatrix(h.getWeights());
     System.out.println("\nPattern result of test");
     Matrix.showVector(result);

     h.showAuxVector();
 }

,运行测试后你可以看到

Running HopfieldTest

Connections of Network: 72

Good recuperation capacity of samples: 1

Perfect recuperation capacity of samples: 1

Energy: -32.0

Weight Matrix
 0.0        0.0     2.0    -2.0      2.0       -2.0       0.0       0.0     0.0
 0.0        0.0     0.0     0.0      0.0        0.0      -2.0       2.0    -2.0
 2.0        0.0     0.0    -2.0      2.0       -2.0       0.0       0.0     0.0
-2.0        0.0    -2.0     0.0     -2.0        2.0       0.0       0.0     0.0
 2.0        0.0     2.0    -2.0      0.0       -2.0       0.0       0.0     0.0
-2.0        0.0    -2.0     2.0     -2.0        0.0       0.0       0.0     0.0
 0.0       -2.0     0.0     0.0      0.0        0.0       0.0      -2.0     2.0
 0.0        2.0     0.0     0.0      0.0        0.0      -2.0       0.0    -2.0
 0.0       -2.0     0.0     0.0      0.0        0.0       2.0      -2.0     0.0

Pattern result of test 

 1.0        1.0     1.0     -1.0     1.0       -1.0      -1.0       1.0     -1.0
-------------------------
The auxiliar vector is empty

我希望这可以帮助你

You can checkout this repository --> Hopfield Network

There you have an example for test a pattern after train the Network off-line.
This is the test

 @Test
 public void HopfieldTest(){
     double[] p1 = new double[]{1.0, -1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0};
     double[] p2 = new double[]{1.0, 1.0,1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0};
     double[] p3 = new double[]{1.0, 1.0,-1.0,-1.0,1.0,-1.0,-1.0,1.0,-1.0};

     ArrayList<double[]> patterns = new ArrayList<>();
     patterns.add(p1);
     patterns.add(p2);

     Hopfield h = new Hopfield(9, new StepFunction());

     h.train(patterns); //train and load the Weight matrix

     double[] result = h.test(p3); //Test a pattern

     System.out.println("\nConnections of Network: " + h.connections() + "\n"); //show Neural connections
     System.out.println("Good recuperation capacity of samples: " + Hopfield.goodRecuperation(h.getWeights().length) + "\n");
     System.out.println("Perfect recuperation capacity of samples: " + Hopfield.perfectRacuperation(h.getWeights().length) + "\n");
     System.out.println("Energy: " + h.energy(result));

     System.out.println("Weight Matrix");
     Matrix.showMatrix(h.getWeights());
     System.out.println("\nPattern result of test");
     Matrix.showVector(result);

     h.showAuxVector();
 }

And after run the test you can see

Running HopfieldTest

Connections of Network: 72

Good recuperation capacity of samples: 1

Perfect recuperation capacity of samples: 1

Energy: -32.0

Weight Matrix
 0.0        0.0     2.0    -2.0      2.0       -2.0       0.0       0.0     0.0
 0.0        0.0     0.0     0.0      0.0        0.0      -2.0       2.0    -2.0
 2.0        0.0     0.0    -2.0      2.0       -2.0       0.0       0.0     0.0
-2.0        0.0    -2.0     0.0     -2.0        2.0       0.0       0.0     0.0
 2.0        0.0     2.0    -2.0      0.0       -2.0       0.0       0.0     0.0
-2.0        0.0    -2.0     2.0     -2.0        0.0       0.0       0.0     0.0
 0.0       -2.0     0.0     0.0      0.0        0.0       0.0      -2.0     2.0
 0.0        2.0     0.0     0.0      0.0        0.0      -2.0       0.0    -2.0
 0.0       -2.0     0.0     0.0      0.0        0.0       2.0      -2.0     0.0

Pattern result of test 

 1.0        1.0     1.0     -1.0     1.0       -1.0      -1.0       1.0     -1.0
-------------------------
The auxiliar vector is empty

I hope this can help you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文