如何将非时间序列数据加载到 simulink 中以用于深度神经网络
How to load non timeseries data into simulink for use in a deep neural network
我在 python 中训练了一个神经网络,并希望将权重加载到 simulink 中以传递到将构建网络的函数中。我以为我可以从工作区使用,但它似乎不处理结构的非时间序列数据。我收到错误消息。
Invalid structure-format variable specified as workspace input in 'PMSM_FCS_MPC/From Workspace'. If
the input signal is a bus signal, the variable must be a structure of MATLAB timeseries objects.
Otherwise, the variable must include 'time' and 'signals' fields, and the 'signals' field must be a
structure with a 'values' field.
如何将一堆数组传递给 simulink 函数?
我看到的都是时间序列数据。一组矩阵上没有任何内容,例如在深度神经网络中使用的内容。
不确定您要如何使用这些数据。但是,如果您将这些权重作为主工作区中的数组,则可以简单地在 Simulink 中引用该变量。例如,如果您的工作区中有 K = [1 2],您可以使用任何块并键入 K(1) 或 K(2)。您还可以进行矩阵运算并使用 Mux 模块收集信号。
From Workspace
块设计用于处理时间序列数据(根据您显示的错误消息。)如果您有常量数据,则无需使用它。
如果您有非时间序列数据并且需要它作为 Simulink 信号 然后使用 MATLAB 变量的名称作为 Constant
块中的参数.来自块的信号将具有您的数据值。
如果您使用的是 MATLAB Function
块,那么您还可以将数据作为 参数 参数输入函数。请参阅 Add Parameter Arguments 了解执行此操作的步骤。
我在 python 中训练了一个神经网络,并希望将权重加载到 simulink 中以传递到将构建网络的函数中。我以为我可以从工作区使用,但它似乎不处理结构的非时间序列数据。我收到错误消息。
Invalid structure-format variable specified as workspace input in 'PMSM_FCS_MPC/From Workspace'. If
the input signal is a bus signal, the variable must be a structure of MATLAB timeseries objects.
Otherwise, the variable must include 'time' and 'signals' fields, and the 'signals' field must be a
structure with a 'values' field.
如何将一堆数组传递给 simulink 函数?
我看到的都是时间序列数据。一组矩阵上没有任何内容,例如在深度神经网络中使用的内容。
不确定您要如何使用这些数据。但是,如果您将这些权重作为主工作区中的数组,则可以简单地在 Simulink 中引用该变量。例如,如果您的工作区中有 K = [1 2],您可以使用任何块并键入 K(1) 或 K(2)。您还可以进行矩阵运算并使用 Mux 模块收集信号。
From Workspace
块设计用于处理时间序列数据(根据您显示的错误消息。)如果您有常量数据,则无需使用它。
如果您有非时间序列数据并且需要它作为 Simulink 信号 然后使用 MATLAB 变量的名称作为 Constant
块中的参数.来自块的信号将具有您的数据值。
如果您使用的是 MATLAB Function
块,那么您还可以将数据作为 参数 参数输入函数。请参阅 Add Parameter Arguments 了解执行此操作的步骤。