| Fuzzy Logic Toolbox | ![]() |
Training routine for Sugeno-type FIS (MEX only).
Syntax
[fismat,error1,stepsize] = anfis(trnData) [fismat,error1,stepsize] = anfis(trnData,fismat) [fismat1,error1,stepsize] = ...[fismat1,error1,stepsize,fismat2,error2] = ... [fismat1,error1,stepsize,fismat2,error2] = ...
Description
This is the major training routine for Sugeno-type fuzzy inference systems. anfis uses a hybrid learning algorithm to identify parameters of Sugeno-type fuzzy inference systems. It applies a combination of the least-squares method and the backpropagation gradient descent method for training FIS membership function parameters to emulate a given training data set. anfis can also be invoked using an optional argument for model validation. The type of model validation that takes place with this option is a checking for model overfitting, and the argument is a data set called the checking data set.
The arguments in the above description for anfis are as follows:
anfis with an initial set of membership functions for training. Without this option, anfis will use genfis1 to implement a default initial FIS for training. This default FIS will have two membership functions of the Gaussian type, when invoked with only one argument. If fismat is provided as a single number (or a vector), it is taken as the number of membership functions (or the vector whose entries are the respective numbers of membership functions associated with each respective input when these numbers differ for each input). In this case, both arguments of anfis are passed to genfis1 to generate a valid FIS structure before starting the training process.
NaN the default options will be in force. These options are as follows:
trnOpt(1): training epoch number (default: 10)
trnOpt(2): training error goal (default: 0)
trnOpt(3): initial step size (default: 0.01)
1, which means the corresponding information is displayed. A 0 means the corresponding information is not displayed on the screen. When any display option is entered as NaN, the default options will be in force. These options are as follows:
dispOpt(1): ANFIS information, such as numbers of input and output membership functions, and so on (default: 1)
dispOpt(2): error (default: 1)
1 for the hybrid method or 0 for the backpropagation method. The default method is the hybrid method, which is a combination of least squares estimation with backpropagation. The default method is invoked whenever the entry for this argument is anything but 0.
The training process stops whenever the designated epoch number is reached or the training error goal is achieved.
The range variables in the above description for anfis are as follows:
fismat1 is the FIS structure whose parameters are set according to a minimum training error criterion.
error1 or error2 is an array of root mean squared errors representing the training data error signal and the checking data error signal, respectively.
stepsize is an array of step sizes. The step size is decreased (by multiplying it with the component of the training option corresponding to the step size decrease rate) if the error measure undergoes two consecutive combinations of an increase followed by a decrease. The step size is increased (by multiplying it with the increase rate) if the error measure undergoes four consecutive decreases.
fismat2 is the FIS structure whose parameters are set according to a minimum checking error criterion.
anfis has certain restrictions, see Constraints of anfis for more information.
Examples
x = (0:0.1:10)';
y = sin(2*x)./exp(x/5);
trnData = [x y];
numMFs = 5;
mfType = 'gbellmf';
epoch_n = 20;
in_fismat = genfis1(trnData,numMFs,mfType);
out_fismat = anfis(trnData,in_fismat,20);
plot(x,y,x,evalfis(x,out_fismat));
legend('Training Data','ANFIS Output');
See Also
References
Jang, J.-S. R., "Fuzzy Modeling Using Generalized Neural Networks and Kalman Filter Algorithm," Proc. of the Ninth National Conf. on Artificial Intelligence (AAAI-91), pp. 762-767, July 1991.
Jang, J.-S. R., "ANFIS: Adaptive-Network-based Fuzzy Inference Systems," IEEE Transactions on Systems, Man, and Cybernetics, Vol. 23, No. 3, pp. 665-685, May 1993.
| addvar | anfisedit | ![]() |