Predictive control based on neural network, application of neural network predictive system

How to transplant the computer-trained neural network to the app

Google AI Writing Project: Neural Network Pseudo-Original

How to transplant the computer-trained neural network to the app

There are two lines of thought for writing about cats .

An online method: the mobile terminal does preliminary preprocessing, and transmits the data to the server to execute the deep learning model. Now many APPs are based on this idea. The advantage is that the deployment of this method is relatively simple, and ready-made frameworks (caffe, theano, mxnet, Torch) can do it. It can be used directly after packaging. The server has high performance and can handle relatively large models. The disadvantage is that it must be connected to the Internet.

The other is the offline method: deploy an appropriate model according to the performance of the hardware. The advantage is that it can be performed offline.

The disadvantages are also obvious. 1) Limited hardware, you may need to run a castrated version of the model, which will have a certain impact on the accuracy of the model; 2) It is troublesome to transplant the ready-made framework to the mobile platform, and the separation of various dependencies is very painful. mxnet There is an example of an Android app (Leliana/WhatsThis GitHub), Torch 7 is also an Android version of soumith/torch-android GitHub, you can refer to it, of course, if you have strong programming skills, you can write a network prequel code yourself.

How to transplant the computer-trained neural network to the app

This needs to be reprogrammed. If the program on your computer is not compatible with the APP program on your mobile phone, there is no way.

Or, if those files are matched, they generally need to be written into a certain file of the APP program. First, you need to find the file written by your computer program, and then copy it to the place where the program of the mobile APP is written to facilitate reading.

Can the function of NeuroSolutions for Excel implement multiple neural networks?

A neural network is a system that can adapt to new environments. It has the ability to analyze, predict, reason, and classify for repeated learning of past experience (information). It is a system that can imitate the human brain to solve complex problems. Compared with conventional systems (using statistical methods, pattern recognition, classification, linear or nonlinear methods), neural network-based systems have more powerful functions and analytical problem skills, and can be used to solve signal processing, simulation prediction, Analyzing complex issues such as decision making.

At present, neural networks have been widely applied to data-intensive enterprises. This article mainly introduces the application field of neural network and recommends NeuroSolutions, the most powerful neural network software on the market.

Neural network application areas Process Modeling and Control (Process Modeling and Control) creates a neural network model for a physical device and uses this model to determine the optimal control settings for the device.

Machine Diagnostics (Machine Diagnostics) When a machine failure is detected, the system can automatically shut down the machine.

Portfolio Management allocates securities assets for investment in a high-return, low-risk manner.

Target Recognition (Target Recognition) detects whether there is an enemy target through video or infrared image data, and is widely used in the military field.

Medical Diagnosis assists physicians in diagnosis by analyzing reported symptoms and MRI, X-ray image data. Credit Rating (Credit Rating) automatically conducts credit ratings on companies or individuals based on their financial status.

The target market (targeted marketing) is based on statistics to find out the group with the highest response rate to marketing activities. Voice Recognition converts speech into ASCII text.

Economic forecasting (Financial Forecasting) predicts the security of future economic activities through historical security data.

Quality Control ties cameras or sensors to the final stages of the production process to automatically check products for defects.

Intelligent Searching Internet search engines provide the most relevant content and advertisements based on a user's past behavior. Fraud Detection detects fraudulent credit card transactions and automatically declines payments.

Optical Character Recognition (OCR) mentioned in the article Introduction to Artificial Neural Networks and OCR Software Application Examples, printed documents are scanned and converted into an electronic format, such as ASCII text, for easier manipulation and/or more efficient storage.

Neural network software recommendation NeuroSolutions is the most popular neural network simulation software, which can help you quickly build the neural network you want, and make it easy for you to train and test your network.

NeuroSolutions provides more than 90 kinds of visual neural components, allowing users to arbitrarily connect and synthesize different network architectures to realize neural network simulation and professional applications. Professional software is beyond the reach of other products of the same level.

Neural network application fields and neural network software recommendations NeuroSolutions features: 1. Object-oriented, easy-to-use graphical man-machine interface, you can use the drag and drop method to build the network model you want 2. Provide NeuralWizard to help find the required network, and Automatically construct the model you need 3. Provide the NeuralExpert expert analysis system to assist in the construction of the network model by querying 4. NeuroSolutions for Excel, allowing you to input data through Excel, build a network, and test the model 5. Have a dynamic neural network model analysis.

BP neural network population prediction program (matlab implementation)

x=[54167 55196 56300 57482 58796 60266 61465 62828 64653 65994 67207 66207 65859 67295 69172 70499 72538 74542 76368 78534 1 11026 112704 114333 115823 117171 118517 119850 121121 122389 123626 124761 125786 126743 127627 128453 129227 129988 130756 131448 132129 132802 134480 135030 135770 136460 13 7510]';% This script is used for NAR neural network prediction% Author: Macer Cheng lag=3; % Autoregressive order iinput=x; % x is the original sequence (row vector) n=length(iinput);% prepare input and output data inputs=zeros(lag,n-lag);for i=1:n-lag inputs(:,i)=iinput(i :i+lag-1)';endtargets=x(lag+1:end);% Create network hiddenLayerSize = 10; %Number of hidden layer neurons net = fitnet(hiddenLayerSize);% Avoid overfitting, divide training, test and verification data ratio net.divideParam.trainRatio = 70/100;net .divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100;% training network [net,tr] = train(net,inputs,targets);%% Judging whether the fit is good or bad according to the chart yn=net( inputs);errors=targets-yn;figure, ploterrcorr(errors) % draw autocorrelation of errors (20lags) figure, parcorr(errors) % draw partial correlation %[h,pValue,stat,cValue]= lbqtest(errors ) %Ljung-Box Q test (20lags) figure,plotresponse(con2seq(targets),con2seq(yn)) % see the predicted trend and the original trend%figure, ploterrhist(errors) % error histogram%figure, plotperform(tr) %Error descending line%% Forecast below for several time periods fn=7; %The number of forecast steps is fn.tr] = train(net,inputs,targets);%% Judging whether the fit is good or bad according to the chart yn=net(inputs);errors=targets-yn;figure, ploterrcorr(errors) %The autocorrelation of plotting errors (20lags) figure, parcorr(errors) % draw partial correlation %[h,pValue,stat,cValue]= lbqtest(errors) %Ljung-Box Q test (20lags) figure,plotresponse(con2seq(targets),con2seq(yn))% Look at the forecasted trend and the original trend %figure, ploterrhist(errors) % error histogram %figure, plotperform(tr) % error drop line %% The following forecasts predict several time periods in the future fn=7; %The number of forecast steps is fn .tr] = train(net,inputs,targets);%% Judging whether the fit is good or bad according to the chart yn=net(inputs);errors=targets-yn;figure, ploterrcorr(errors) %The autocorrelation of plotting errors (20lags) figure, parcorr(errors) % draw partial correlation %[h,pValue,stat,cValue]= lbqtest(errors) %Ljung-Box Q test (20lags) figure,plotresponse(con2seq(targets),con2seq(yn))% Look at the forecasted trend and the original trend %figure, ploterrhist(errors) % error histogram %figure, plotperform(tr) % error drop line %% The following forecasts predict several time periods in the future fn=7; %The number of forecast steps is fn .ploterrhist(errors) %error histogram%figure, plotperform(tr) %error descending line%% Forecast below for several time periods fn=7; %The number of forecast steps is fn.ploterrhist(errors) %error histogram%figure, plotperform(tr) %error descending line%% Forecast below for several time periods fn=7; %The number of forecast steps is fn.

f_in=iinput(n-lag+1:end)';f_out=zeros(1,fn); %Forecast output% For multi-step prediction, use the following loop to re-input the network output for i=1:fn f_out(i )=net(f_in); f_in=[f_in(2:end);f_out(i)];end% Draw the forecast figure figure,plot(1949:2013,iinput,'b',2013:2020,[iinput( end), f_out],'r') Figure 1 Autocorrelation Figure 2 Error Figure 3 Prediction The above program is universal, as long as you can modify it and use it in other places according to your own needs, the basic idea is to use the previous lag years The population is used to predict the population of the next year. As for the lag, you can change it yourself.

Also, in judging whether the result is good or bad, it is not enough to just look at the error graph. If it is a good prediction, then except for the 0th order autocorrelation in the autocorrelation graph, the other autocorrelation coefficients should not exceed the upper and lower confidence interval.

There are other statistics and charts are written after "%", if necessary, remove it and use it.

The final predicted value is f_out and my predicted value is 138701.065269972 139467.632609654 140207.209707364 141210.109373609 141981.285378849 142461.332139592 143056.0 73139776.

[Neural network time series] Ask NAR network forecasting questions, thank you

The NAR network has only y(t), and the NARX network has x(t) and y(t). For the NAR network, it can only output the next value relative to the delay vector. Therefore, it is necessary to continuously update the collection with a loop to advance the time step.

T=tonndata(force,false,false); %The input and output matrices must be cell-type matrices, and cannot be converted with num2cell. If a two-dimensional cell matrix is ​​used, it will be considered as two inputs and cannot be trained. Suppose The force dataset has only 50 (one row).

force_raw=T(1:30); %Create a 1*30 Xi, which corresponds to the delay vector 1:30. is a known matrix.

for j=1:50 The first 20 of %y1 are compared with the 31st to 50th data in the force, plus the next 30 data can be predicted.

y1(j)=net(T(10),force_raw); %We still need advice from God here, T(10) contains the current matrix, the number can be chosen arbitrarily, and the result is the same.

Just to output a one-dimensional matrix force_raw=[force_raw(2:end),y1(j)]; %Update to get a new known matrix, which is 2,3~,30,31, the first line of the next step should be to get the first 43.

Constantly updated to get the predicted value.

How matlab neural network multi-step forecast, rolling forecast

Please do a simple BP neural network prediction, thank you very much! ! ! 100

It is really because the extrapolation ability is limited, so I hope to use the extrapolation model: P=(data 1~data n) T=(data n~data n+m) to make the data input/output within the range, such as P=[一Monthly precipitation, February precipitation `May precipitation, February precipitation, March precipitation.

`Precipitation in June...] T=[precipitation in June, precipitation in July...] After training, because the precipitation is within a certain range, it does not have the characteristics of continuous extension. Use [precipitation in June, precipitation in July.

`November precipitation] can be derived from [December precipitation], so it can be controlled near the sample range if it has been extended such as P=[1,2,3,4,5], T=[January precipitation, February precipitation` Precipitation in May]; then 6 cannot be deduced, so if you don’t understand the precipitation in June, please continue to ask.

How to transplant the computer-trained neural network to the app

Are you training or using a trained network. If it is training, it depends on the size of your training data. I have 100,000 pieces of data before, 22 inputs, and 1 output. Training with matlab is also an ordinary home computer.

If you just use a trained neural network, there are no requirements for configuration at all! Predictions for each input are simple arithmetic operations. "The House of Neural Networks"

 

Guess you like

Origin blog.csdn.net/aifamao6/article/details/127459748