主要内容

神经网络 Simulink 模块库

Deep Learning Toolbox™ 产品提供一组模块,您可以通过 Simulink® 使用这些模块构建神经网络,或使用函数 gensim 生成您使用 MATLAB® 创建的任何网络的 Simulink 版本。

要打开 Deep Learning Toolbox 模块库,请在 MATLAB 命令行窗口中输入:

neural

此命令将打开一个包含五个模块的库窗口。其中每个模块都包含附加模块。

Simulink window with five blocks: Transfer Functions, Net Input Functions, Weight Functions, Processing Functions, and Control Systems.

传递函数模块

双击 Neural library 窗口中的 Transfer Functions 模块,以打开一个包含多个传递函数模块的窗口。

Simulink window showing the different transfer functions.

其中每个模块都接受一个净输入向量,并生成一个对应的输出向量,其维度与输入向量相同。

净输入模块

双击 Neural library 窗口中的 Net Input Functions 模块,以打开一个包含两个净输入函数模块的窗口。

Simulink window with two net-input function blocks: netsum and netprod.

其中每个模块都接受任意数量的加权输入向量、加权层输出向量和偏置向量,并返回一个净输入向量。

权重模块

双击 Neural library 窗口中的 Weight Functions 模块,打开一个包含四个权重函数模块的窗口。

Simulink window showing four weight function blocks: dotprod, dist, negdist, and normprod.

其中每个模块都接受一个神经元的权重向量,并将其应用于一个输入向量(或层输出向量),以获得神经元的加权输入值。

这些模块要求神经元权重向量是列向量。这是因为 Simulink 信号可以为列向量,但不能为矩阵或行向量。

由于存在此限制,要实现要输入到包含 S 个神经元的层的权重矩阵,您必须创建 S 个权重函数模块(每行对应一个)。

这与另外两种模块形成对比。每层只需要一个净输入函数模块和一个传递函数模块。

处理模块

双击 Neural library 窗口中的 Processing Functions 模块,以打开一个包含处理模块及其对应的反向处理模块的窗口。

Simulink window showing processing function blocks.

其中每个模块都可用于预处理输入和后处理输出。