mahdyfo/rotifer

创建深度学习网络结构的遗传AI

v1.1.0 2023-09-10 17:28 UTC

This package is auto-updated.

Last update: 2024-09-29 05:49:16 UTC


README

遗传机器学习框架

自主进化:从简单到复杂

这是一个自我设计的进化遗传AI框架(AutoML)。我相信最强大的AI是能够自我创造的,就像我们的头脑一样,拥有复杂且人类难以理解的结构。

解决XOR示例

php xor.php

主要部分

世界代理神经元基因编码器激活函数繁殖

层次结构

Single Layer neural network with intra-connections

这两个神经网络是相同的。所有隐藏层都可以通过内部连接合并成一个单层。

这种方式我们消除了手动配置神经元和层计数的需要。经过遗传算法的几代进化后,这个单层隐藏层变得非常复杂,对人类来说难以理解。对我们来说这并不重要,因为我们不想分析它们。我们只想让网络强大,而它确实会非常强大。

示例

$data = [
    [[0, 0, 0], [1]],
    [[0, 0, 1], [0]],
    [[0, 1, 0], [0]],
    [[0, 1, 1], [1]],
    [[1, 0, 0], [1]],
    [[1, 0, 1], [0]],
    [[1, 1, 0], [0]],
    [[1, 1, 1], [1]],
];

Generation 1 - Best generation fitness: 5.3965296271639 - Best overall fitness: 5.3965296271639
Generation 50 - Best generation fitness: 5.9992278738651 - Best overall fitness: 5.9992278738651
Generation 100 - Best generation fitness: 6.0455893609229 - Best overall fitness: 6.7389574321586
Generation 150 - Best generation fitness: 7.4842880310069 - Best overall fitness: 7.6137585607025
Generation 200 - Best generation fitness: 7.5486734099125 - Best overall fitness: 7.9401862706856

Report:
  Best fitness => 7.940186270685596
  Hidden Neurons Count => 7
  Connections Count => 52
  
Test:
    Rounded Output: 1 - Raw output: 0.99712500243069
    Rounded Output: 0 - Raw output: 0.00030062252549047
    Rounded Output: 0 - Raw output: 0.0019566823546141
    Rounded Output: 1 - Raw output: 0.99504714984784
    Rounded Output: 1 - Raw output: 0.99970922413458
    Rounded Output: 0 - Raw output: 0.00004324516515
    Rounded Output: 0 - Raw output: 0.0042442188361674
    Rounded Output: 1 - Raw output: 0.95487230539894