【发布时间】:2014-04-12 13:59:56
【问题描述】:
简述
神经网络能否模拟阶乘分解(或其他一些方法)以在给定排列唯一索引的情况下提供列表排列?
应用
我有一个包含 10 件事的清单,它们是什么无关紧要。我关心的是我的 10 个东西可以放入 3628800 个(或 10 个!)唯一顺序,因为这样我就可以使用无符号整数和阶乘分解来表达我的 10 个东西的任何列表顺序:
Order 0: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Order 1: 0, 1, 2, 3, 4, 5, 6, 7, 9, 8
Order ....
Order 3628799: 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
这允许在我的 10 件事的不同列表顺序上并行分布分析。
一个常见的例子是旅行商问题:
1. I give 500 different computers each a range of unsigned integers:
0 -> 7257 for computer 0,
7257 -> 14516 for computer 1,
etc.
2. Each computer first calculates the list order from it's unsigned integer
index by using factorial decomposition.
ie. Order 1 -> 0, 1, 2, 3, 4, 5, 6, 7, 9, 8
3. The distance between the cities placed in the order described is calculated.
4. The shortest distances from each computer is collected, and the shortest
of those is taken. Leaving us with a single unsigned integer index that
describes the shortest possible permutation of cities.
同样的过程可以用来解决几乎任何有界的误差面,通常远远超过可行的计算能力。
递归算法解决方案
我们可以使用阶乘分解 (outlined here in php) 计算任何固定大小列表的第 N 次排列(当然,我们需要对更大的列表提供大整数支持),并在此处以 javascript 的形式提供,以便清楚起见:
function ithPermutationOfNElements (n, i)
{
var j, k = 0;
var fact = [];
var perm = [];
// compute factorial numbers
fact[k] = 1;
while (++k < n)
fact[k] = fact[k - 1] * k;
// compute factorial code
for (k = 0; k < n; ++k)
{
perm[k] = Math.floor(i / fact[n - 1 - k]);
i = i % fact[n - 1 - k];
}
// readjust values to obtain the permutation
// start from the end and check if preceding values are lower
for (k = n - 1; k > 0; --k)
for (j = k - 1; j >= 0; --j)
if (perm[j] <= perm[k])
perm[k]++;
return perm;
}
console.log(ithPermutationOfNElements(4, 23)); // [ 3, 2, 1, 0 ]
神经网络解决方案?
任何神经网络架构和训练组合都可以在给定 i 的情况下模拟这个函数吗?因为它只有输入神经元和 n 个输出神经元代表排列的每个元素?
【问题讨论】:
-
非常好的和明确的问题。
-
假设正确答案是肯定的,而合理的答案是否定的,那么一个很好的后续问题将是:NN 需要多少层才能完成此任务以及训练它的最佳方法是什么。
-
@Peter Micheal Lacey-Bordeaux 使用 NN 解决这个问题与正常使用 NN 完全不同。执行此操作的“算法”方法是将许多神经元用作逻辑门,因此现在您将神经元与非门/触发器等用作加法器/乘法器/锁存器等,直到您基本上在高水平上构建了图灵机。它绝不会像普通的神经网络,因为它们被人工智能世界的大多数人使用。此外,您面前已经有一台非常好的图灵机。
-
@andrelucas 如果你可以在你的回答中加入并扩展它,我会选择它作为获胜者
-
@Peter 你找不到这样的正式证明。仅仅是因为,如果您将我在下面显示的简单 NN AND 门视为实际的工作 NN,那么根据该定义,实际的硬件 AND 门也是 NN。所以现在任何由普通硬件逻辑门组合而成的东西都是NN(包括普通计算机)。因此,在过程逻辑中实现的阶乘分解的性能/效率将与 NN 实现相同 - 如果您使用该术语的最宽松的定义。但在人工智能世界中,没有人会指着一个硬件与门说,“是的,那是一个神经网络”。
标签: algorithm machine-learning neural-network