NeuroEvolution: Towards a New Generation of Neural Netw
作者:禅与计算机程序设计艺术
1.简介
Artificial Intelligence (AI) stands as a prominent field of study in computer science, currently marked by notable advancements achieved at this year's ICLR and ICML conferences. Despite these achievements, the field continues to present significant challenges that remain unresolved.
A key obstacle lies in the creation of novel machine learning algorithms capable of extracting intricate functional relationships from vast data sets without relying on prior knowledge or supervision. This endeavor necessitates the design of intelligent search strategies aimed at identifying optimal solutions while addressing the challenges posed by high-dimensional spaces. One widely recognized algorithm, Evolutionary Computation (EC), which draws inspiration from biological evolution principles, has demonstrated success in solving optimization problems like neural network training. In this study, we present a similar approach termed Neuro-evolution (NE), which leverages artificial neural networks as its foundational framework. The proposed Neuro-evolution approach integrates evolutionary computation techniques with biological neural network principles, enabling the discovery of optimal neural network architectures through evolutionary processes rather than traditional feature engineering methods. Additionally, we introduce several innovative features, including hierarchical representation schemes and dynamic mutation rates, to enhance the performance capabilities of NE. Furthermore, we explore the applicability of this methodological framework to diverse domains such as reinforcement learning, transfer learning, and time series prediction.
This paper aims to elucidate the essential concepts and terminology associated with NE. Subsequently, we will demonstrate the core algorithm by outlining its operational procedures and mathematical formulations. Furthermore, we will provide illustrative examples showcasing how NE can be applied to diverse tasks such as neural network training tasks, transfer learning applications, reinforcement learning methodologies, and time series forecasting techniques. In conclusion, this paper will explore potential avenues for enhancing NE's performance while also examining its limitations and outlining possible extensions.
2.Terminology
Before delving into the specifics of NE, it would be beneficial to review the fundamental terminology and notations introduced in this paper. This table effectively provides a comprehensive overview of the essential terminology required to grasp the concepts presented in this paper. You are encouraged to bypass this section if you are already familiar with the key terminology.
| Term | Definition |
|---|---|
| Population | A set of individuals |
| Individual | An instance of solution |
| Genome | A fixed-length sequence of weights |
| Weight | A single value representing the effectiveness of input connection |
| Connection | Two individual nodes connected by a weight |
| Node | A unit in a neural network |
| Network | A set of connections between nodes |
| Evaluation | Measuring the fitness of an individual |
| Fitness | Quality measure of an individual |
| Parents | Individuals selected for reproduction |
| Survival Prob. | The probability of surviving after reproducing |
| Mutation Rate | The frequency with which a gene mutates during evolution |
| Crossover | The process of combining two parent genomes to create offspring |
| Hebbian Rule | Principle underlying the formation of synaptic connections between neurons based on overlap of their inputs |
A neural network is composed of a layered structure comprising interconnected nodes. These nodes accept input data and generate corresponding output. Each node includes numerous weighted connections that link it either to other neurons within its own layer or to neurons in subsequent layers. The weight assigned to each connection reflects its significance relative to an individual input variable, whereas collective neuronal activation depends on summed inputs multiplied by their respective weights.
- Core Algorithm
神经进化是一种迭代的优化技术,在解决复杂问题时应用了进化计算的方法。该过程涉及创建候选解的种群,并根据特定标准对其进行评估;选择表现最佳的个体作为繁殖对象;通过交叉和突变操作生成新的个体;直至获得令人满意的解决方案。
The core concept behind Neuro-evolution is to draw inspiration from the natural selection process and integrate evolutionary principles into neural networks. Here's how NE operates: it generates a population of neural network architectures, evaluates their fitness based on a specific task, selects the best-performing ones, and uses them to create the next generation through mutation and crossover.
The initialization process begins with a randomly initialized population composed of randomly generated neural networks.
-
Evaluation - Assess each individual's fitness through measuring their capability to perform designated tasks, such as refining neural network parameters to reduce loss on a given dataset. For instance, we could evaluate each neural network using a validation set and retain only those achieving superior performance for progression.
-
Selection - Utilize a fitness-based selection technique employing a roulette wheel method, where individuals' fitness scores correspond to their likelihoods of survival. Select parent pairs characterized by significant congruence across both genetic and behavioral attributes, ensuring preservation of genetic and behavioral traits in subsequent generations through this process guarantees
-
繁殖 - 利用交叉和变异操作,在生成子代网络结构时整合父代遗传信息。在交叉过程中,在每个父代中选择遗传材料片段并将其组合以产生新个体;在变异过程中,在子代中引入微小修改以增强其适应环境变化的能力。
-
Replace the entire old population - Replace the entire old population with those generated in step four, typically employing elitist strategies to maintain the most successful individuals. Then repeat steps two through four for a predetermined number of iterations.
Here are the key steps involved in implementing Neuro-evolution:
设置种群:随机地对神经网络群体进行初始化,并对每个网络和其中的每个节点进行命名。
- 评估整个群体 - 使用评估函数计算每种网络在群体中的适应度。根据优化的目标任务选择合适的评价指标,如准确率、均方误差(MSE)或负对数似然(NLL)。将这些适应度值归一化处理以确保它们在0到1之间。
Establish an archive - Make a copy of the current state of the population just prior to commencing the evolution process. This facilitates maintenance of consistency and reproducibility when conducting subsequent experiments.
从下一代开始 - 采用进化算法进行选择阶段,并在此阶段中选择适合重组的父母。
根据每个个体的适应度分数使用轮盘赌法来分配生存概率。
通过交叉操作或突变操作产生新的子代群体。
突变操作涉及在子代基因型中添加微小的变化以确保其稳定性。
交叉操作涉及从多个父代中交换遗传物质以产生新的特征组合。
完成生成后按照适应度分数从高到低排序并筛选出表现不佳的个体将其替换为刚刚产生的新成员。
这样可以保留精英并促进群体多样性得以维持并提升其适应性水平。
Until convergence is achieved, continue performing the aforementioned process by iterating through the steps outlined in this algorithm. Terminate once either convergence occurs or the maximum generation count has been reached. If no improvement is observed over a set number of consecutive iterations, abandon further iterations to prevent premature termination.
- Perform export operations - Extract relevant statistics from the final population, then perform export operations to facilitate analysis and visualization.
The program should archive old populations by saving copies alongside the existing population status, ensuring that they can be accessed as a reference basis.
When engaging with real-world applications, it's imperative to address computational efficiency and scalability challenges. To mitigate these challenges, Neuro-evolution is commonly executed in tandem by leveraging multi-threading or distributed computing resources during the evaluation of diverse network configurations. Furthermore, enhancing the performance of neural network training can be achieved through advanced hyperparameter tuning techniques like grid search or Bayesian optimization. This approach enables balancing speed against quality while managing costs effectively.
- Examples
We now shift our focus towards specific examples that demonstrate the application of NE across various tasks such as neural network training tasks, transfer learning applications, reinforcement learning techniques, and time series forecasting challenges.
-
Neural Network Training 训练神经网络是NE的一种经典应用。假设我们有一个带标签的输入数据集x和目标标签y,则可以按照以下步骤使用NE进行神经网络训练:
-
构建适应度函数 - 对于训练好的模型M,在其输出空间中定义一个适应度指标f(x,y),其值为L(f(x), y),其中L()表示损失函数(如交叉熵损失或均方误差损失)。该适应度函数用于衡量预测输出与实际目标之间的相似程度。
Develop a neural network-based controller system. Formulate a controller function Θ(x;w) that takes inputs x and produces corresponding predictions f(x), while adjusting its weights w through learning from the discrepancy between predicted outputs f(x) and actual target values.
Use NE to train, which involves running NE to evolve both the architecture and parameter values until a satisfactory level of fit is achieved. The controller is designed to adjust the network's weights so as to minimize a defined loss function. NE can employ a combination of mutation and crossover operators to modify both structure and weights, allowing for fine-tuning. By adjusting mutation rates and survivorship rates, we can balance exploration against exploitation effectively.
- 转移学习
转移学习是指将预训练模型学到的能力转移到另一个任务的过程。它允许模型在无需从头训练的情况下,在相关的新任务上表现良好。转移学习在深度学习中通常用于提高准确性并减少训练时间。
Implementing transfer learning with NE, we adhere to the same procedure as previously outlined, beginning with a pre-trained model M_pre instead of initializing the network's weights randomly.
Set the initial state of the population by transferring weights and biases from the pretrained model M_pre, while randomly initializing remaining parameters.
Assess the entire population - Determine the fitness of transferred models by applying the same evaluation metric employed during normal training, i.e., test loss.
- Generate an archive - Additionally, make a copy of the parameters of weights and biases of the pre-trained neural network model as a basis for comparison.
生成下一代模型(与上一情况类似),通过轮盘赌选择法选择父母,并应用交叉和变异操作来创造转移模型的下一代。然而需要注意的是,并非所有参数都需要调整(因为目标是保持预训练模型的基本架构的同时使其权重适应新的任务需求)。某些参数可能仍需根据新任务的特点及适应程度进行调整。
Until the algorithm converges, the aforementioned process will continue to iterate for a predetermined number of iterations, terminating either upon reaching the state of convergence or exceeding the maximum allowable generation count. Additionally, termination can be performed early when there's no improvement observed over a set number of consecutive generations to prevent premature termination.
- Output the results - Gather statistical data including average fitness, standard deviation of fitness, and architecture distribution within the final population. Visualize trends in fitness progression and model outcomes through graphs and diagrams.
Reinforcement Learning Reinforcement learning is a fundamental concept in AI, characterized by agents interacting with environments to learn optimal actions and policies. Reinforcement learning involves agents engaging with their environments to acquire optimal actions and policies through trial and error. By employing NE, we can design intelligent agents capable of efficiently maximizing rewards despite uncertainties. Through analyzing interactions between agents and environments, NE effectively identifies suitable action sequences and policy formulations that optimize rewards.
假设agent与一个未知环境交互,并需学习选择最大化累积奖励的动作。我们从环境中所有可能动作上赋予非零概率的角度出发,初始化一个均匀策略分布pi。NE提供了一种迭代更新策略直至达到最优策略的方法。
Set the initial state - Randomly distribute agent strategies within the population.
-
Evaluate the population - Use the evaluation function f(pi) = R(pi) + γmaxa'[Q(pi',a')] where R(pi) denotes the total reward obtained under policy pi, Q() denotes the expected future reward, and γ is the discount factor. Here, we first evaluate the total reward under each policy and store them in a fitness vector. We then compute the expected reward for each subsequent action a' under each policy π'. Note that since the objective is to find the most beneficial policy, we do not consider the probability distribution over actions under each policy.
-
建立存档 - 备份一份当前状态用于启动进化过程
在下一阶段中生成EA算法的下一代个体。执行选择操作以从当前种群中筛选出适合进行重组的父代个体,并根据每个体的适应度值确定其生存几率。通过交叉或变异操作生成新的子代群体。在交叉过程中将遗传信息从多个父母中交换以产生新的策略方案,在变异过程中对子代体细胞进行微小改动以促进稳定性并避免陷入局部最优解状态。将所有策略方案按照适应度值从高到低排序后替换掉原始种群中最差表现者,从而保证种群多样性得到保留并推动进化过程向更高水平发展
- 重复直至收敛 - 继续执行上述步骤直至达到指定次数的迭代并收敛,并在超过最大世代数时停止运行。或者,在连续一定代数未见改善时提前终止以避免过早收敛。
导出结果 - 展示生成的政策,并将其与基准政策或 ground truth 进行对比。计算统计显著性测试以确定改进是否具有显著性或无显著性。
导出结果 - 展示生成的政策,并将其与基准政策或 ground truth 进行对比。计算统计显著性测试以确定改进是否具有显著性或无显著性。
- 时间序列预测 时间序列预测在金融、医疗保健、交通和能源等多个行业中都普遍存在。
在此任务中,我们的目标是利用历史数据预测未来值。
通过NE技术设计模型来实现对未来值的精确预测。
主要困难在于处理海量的时间序列数据,
这些数据无法全部存储或一次性处理在内存中。
针对此任务而言,我们假设将历史数据划分为长度为t的子序列,并设定我们的目标为预测每个子序列中最后一个观察值的值。我们可以将每个子序列视为NE框架中的独立实体,并对其进行单独优化。随后,在完成所有预测后,则可进一步推断出整个系统的历史信息
Set the population - 随机设置种群中的隐含单元和噪声分布。这些参数决定了系统的复杂度并引入随机性到系统的固有动力学中。
评估该群体-采用评估函数f(θ)=||y−ŷ||²/√t,在此处y表示子序列中最后一个观察的真实标签而ŷ则代表预测标签值。值得注意的是t为子序列的长度,在计算损失时我们对其进行了归一化处理以消除不同误差量纲的影响
- Create the record - Perform a copy of the current population state prior to initiating the evolutionary process.
4. 生成下一代 - 在进化算法中执行选择阶段以选择用于重组的父母。使用轮盘赌方法根据个体的适应度分数为其分配生存概率。根据所选算子生成新的种群并应用交叉或变异操作符以产生子代个体。在交叉过程中从多个父母交换遗传物质以创建继承双方特性的新个体。在变异过程中对子代的基因型添加小幅度变化以促进鲁棒性和避免局部极小值。按适应度分数排序并用新产生的子代替换原始群体中表现最差的成员。这确保了新世代中遗传多样性被引入。
- 重复直至收敛 - 继续执行上述步骤,在指定数量的迭代次数内或达到收敛状态或超出最大进化代数之前继续进行操作。作为替代方案,在连续若干代未见改进时提前终止,并避免过早收敛。
输出内容
Conclusion To summarize, we have covered the fundamentals of Neuro-evolution and illustrated its practical applications in various machine learning domains such as neural network training, transfer learning, reinforcement learning, and time series analysis. We underscored the significance of meticulous initialization strategies and appropriate evaluation metrics for achieving optimal results. Furthermore, we explored the necessity for investigating various configurations to identify suitable operators and heuristics that can lead to successful outcomes.
