虚拟机可以实现为神经网络吗?

发布于 2024-08-04 20:20:09 字数 348 浏览 1 评论 0原文

免责声明:我不是数学天才,也没有任何编写神经网络的经验。所以,请原谅我在这里所说的任何愚蠢的话。 ;)

我一直读到有关神经网络用于机器学习的内容,但在尝试编写简单的虚拟机时,我开始想知道它们是否可以以另一种方式应用。

具体来说,可以将虚拟机创建为神经网络吗?如果是这样,它会如何工作(如果必须的话,请随意在此处使用抽象描述)?

我听说过 Joycean Machine,但除了非常非常模糊的解释之外我找不到任何信息。

编辑:我在这里寻找的是基于神经网络的虚拟机如何解释汇编的解释。如何处理输入等?每个单独的输入都是一个内存地址吗?我们来集思广益吧!

Disclaimer: I'm not a mathematical genius, nor do I have any experience with writing neural networks. So, please, forgive whatever idiotic things I happen to say here. ;)

I've always read about neural networks being used for machine learning, but while experimenting with writing simple virtual machines, I began to wonder if they could be applied in another way.

Specifically, can a virtual machine be created as a neural network? If so, how would it work (feel free to use an abstract description here, if you have to)?

I've heard of the Joycean Machine, but I can't find any information other than very, very vague explanations.

EDIT: What I'm looking for here is an explanation of exactly how a neural network-based VM would interpret assembly. How would inputs be handled, etc? Would each individual input be a memory address? Let's brainstorm!

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

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

发布评论

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

评论(3

ㄟ。诗瑗 2024-08-11 20:20:09

你真的让我很开心……

由于已经训练好的神经网络与常规状态机没有太大区别,因此为确定性指令集编写神经网络虚拟机是没有意义的。

使用多个指令集或未知集来训练这样的虚拟机可能会很有趣。然而,我怀疑执行这样的训练是否实用,甚至 %99 正确的解释器对传统字节码也没有任何用处。

我能想到的神经网络虚拟机的唯一用途是执行包含模糊逻辑构造或人工智能启发式算法的程序。

一些愚蠢的堆栈机示例来演示这个想法:

push [x1]
push [y1] ;start coord
push [x2]
push [y2] ;end coord
pushmap [map] ;some struct
stepastar ;push the next step of A* heuristics to accumulator and update the map
pop ;do sth with is and pop
stepastar ;next step again
... ;stack top is a map
reward ;we liked the coordinate. reinforce the heuristic
stepastar
... ;stack top is a map
punish ;we didn't like the next coordinate. try something different

这里没有明确的启发式。假设我们将所有状态保留在 *map 中,包括启发式算法。

你会发现它看起来很愚蠢,而且不完全上下文敏感,但如果神经网络不在线学习,它就没有任何价值。

You really made my day buddy...

Since an already trained neural network won't be much different than a regular state machine, there is no point writing a neural network VM for a deterministic instruction set.

It might be interesting to train such a VM with multiple instruction sets or an unknown set. However, I doubt it will be practical to execute such a training and even a %99 correct interpreter will be of any use for conventional bytecode.

The only use of a neural network VM I can think of is executing a program that contains fuzzy logic constructs or AI algorithm heuristics.

Some silly stack machine example to demonstrate the idea:

push [x1]
push [y1] ;start coord
push [x2]
push [y2] ;end coord
pushmap [map] ;some struct
stepastar ;push the next step of A* heuristics to accumulator and update the map
pop ;do sth with is and pop
stepastar ;next step again
... ;stack top is a map
reward ;we liked the coordinate. reinforce the heuristic
stepastar
... ;stack top is a map
punish ;we didn't like the next coordinate. try something different

There is no explict heuristic here. Just assume we keep all state in *map including the heuristic algorithm.

You see it looks silly and not completely context sensitive but a neural network is of no value if it doesn't learn online.

沫离伤花 2024-08-11 20:20:09

当然。毫无疑问,网络相当复杂。

字节码/操作码的大部分解析都是神经网络擅长的模式匹配。

Of course. With a rather complex network no doubt.

Much of the parsing of bytecodes/opcodes is pattern matching which neural networks excel at.

风月客 2024-08-11 20:20:09

您当然可以使用神经网络来做到这一点 - 我可以轻松地看到学习给定字节码片段的正确状态转换。

输入可能类似于:

  • 堆栈顶部的值
  • 当前累加器中
  • 的值当前指令指针处的字节代码
  • 当前数据指针处的字节值 先前
  • 的标志

输出可能类似于:

  • 更改为指令指针
  • 更改为数据指针
  • 更改为累加器
  • 堆栈操作(推入) 、弹出或什么都没有)
  • 内存操作(读取累加器、写入累加器或什么都不做)
  • 新标志

但是-我不确定为什么你首先要这样做。与直接执行字节码相比,神经网络的效率要低得多(并且可能会犯错误,除非你训练得足够好)。无论如何,您可能需要编写一个准确的字节码评估器,只是为了创建足够的训练数据......

此外,根据我的经验,神经网络往往擅长模式识别,但不擅长学习逻辑运算(例如二进制加法或异或)一旦超过一定规模(即超过几个位)。因此,根据指令集的复杂性,网络可能需要大量时间来训练。

You could certainly do this with a neural network - I could easily see learning the correct state transitions for a given piece of bytecode.

Input could be something like:

  • Value at top of stack
  • Value in current accumulator
  • Byte code at current instruction pointer
  • Byte value at current data pointer
  • Previous flags

Output could be something like:

  • Change to instruction pointer
  • Change to data pointer
  • Change to accumulator
  • Stack operation (push, pop, or nothing)
  • Memory operation (read to accumulator, write accumulator or nothing)
  • New flags

However - I'm not sure why you would want to do this in the first place. A neural network would be much less efficient (and potentially make mistakes unless you trained it well enough) compared to just executing the bytecode directly. You'd probably need to write an accurate bytecode evaluator anyway just to create enough training data....

Also, in my experience neural networks tend to be good at pattern recognition but very bad at learning logical operations (like binary addition or XORs) once you get beyond a certain scale (i.e. more than a few bits). So depending on the complexity of your instruction set, the network could take a very large amount of time to train.

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