Embedding a Neural Net
1 次查看(过去 30 天)
显示 更早的评论
I have a NARX model (see attached file for an illustration) to compute the voltage response of an electrical circuit. The output voltage y(t) is a result of both instantaneous and time-delayed effect of applied current x(t). Therefore, the input delay is setup to include the instantaneous value of x(t), along with past values.
I would like to set this up to operate one sample at a time in an infinite loop where the model output (voltage) is compared to the real-time measured voltage:
% Take analog-to-digital measurements of current and voltage
I_meas = current_measurement; % single measurement of current
V_meas = voltage_measurement; % single measurement of voltage
X = con2seq(I_meas); % convert to cell
% Now the neural network computes a single point of modeled voltage
Y_hat = net(X,Xi,Ai);
% Compute the difference between measurement and modeled result
V_hat = cell2mat(Y_hat); % convert back to variable
Model_Error = (V_meas - Y_hat);
repeat loop and take another sample;
How do I setup the net for this usage case?
2 个评论
Greg Heath
2015-2-21
Why in the world would you want to implement this one timestep at a time???
Since there is no such thing as an infinite loop, NEVER try to design a program that has any.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!