我已经找到了!从2007b开始的。
Automated data preprocessing and postprocessing occur during network creation in the Network/Data Manager GUI (nntool), Neural Network Fitting Tool GUI (nftool), and at the command line.
At the command line, the new syntax for using network-creation functions, automates preprocessing, postprocessing, and data-division operations.
For example, the following code returns a network that automatically preprocesses the inputs and targets and postprocesses the outputs:
net = newff(p,t,20);
net = train(net,p,t);
y = sim(net,p);
To create the same network in a previous release, you used the following longer code:
[p1,ps1] = removeconstantrows(p);
[p2,ps2] = mapminmax(p1);
[t1,ts1] = mapminmax(t);
pr = minmax(p2);
s2 = size(t1,1);
net = newff(pr,[20 s2]);
net = train(net,p2,t1);
y1 = sim(net,p2)
y = mapminmax('reverse',y1,ts1);
Default Processing Settings
The default input processFcns functions returned with a new network are, as follows:
net.inputs{1}.processFcns = ...
{'fixunknowns','removeconstantrows', 'mapminmax'}
These three processing functions perform the following operations, respectively:
fixunknowns—Encode unknown or missing values (represented by NaN) using numerical values that the network can accept.
removeconstantrows—Remove rows that have constant values across all samples.
mapminmax—Map the minimum and maximum values of each row to the interval [-1 1].
The elements of processParams are set to the default values of the fixunknowns, removeconstantrows, and mapminmax functions.
The default output processFcns functions returned with a new network include the following:
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'}
These defaults process outputs by removing rows with constant values across all samples and mapping the values to the interval [-1 1].
sim and train automatically process inputs and targets using the input and output processing functions, respectively. sim and train also reverse-process network outputs as specified by the output processing functions.
For more information about processing input, target, and output data, see "Multilayer Networks and Backpropagation Training" in the Neural Network Toolbox User's Guide.
Changing Default Input Processing Functions
You can change the default processing functions either by specifying optional processing function arguments with the network-creation function, or by changing the value of processFcns after creating your network.
You can also modify the default parameters for each processing function by changing the elements of the processParams properties.
After you create a network object (net), you can use the following input properties to view and modify the automatic processing settings:
net.inputs{1}.exampleInput—Matrix of example input vectors
net.inputs{1}.processFcns—Cell array of processing function names
net.inputs{1}.processParams—Cell array of processing parameters
The following input properties are automatically set and you cannot change them:
net.inputs{1}.processSettings—Cell array of processing settings
net.inputs{1}.processedRange—Ranges of example input vectors after processing
net.inputs{1}.processedSize—Number of input elements after processing
Changing Default Output Processing Functions
After you create a network object (net), you can use the following output properties to view and modify the automatic processing settings:
net.outputs{2}.exampleOutput—Matrix of example output vectors
net.outputs{2}.processFcns—Cell array of processing function names
net.outputs{2}.processParams—Cell array of processing parameters
Note These output properties require a network that has the output layer as the second layer.
The following new output properties are automatically set and you cannot change them:
net.outputs{2}.processSettings—Cell array of processing settings
net.outputs{2}.processedRange—Ranges of example output vectors after processing
net.outputs{2}.processedSize—Number of input elements after processing