📜  matlab rbf network (1)

📅  最后修改于: 2023-12-03 14:44:11.025000             🧑  作者: Mango

MATLAB RBF Network

RBF (Radial Basis Function) Network is a type of neural network commonly used for function approximation and classification. The RBF Network consists of three layers, an input layer, a hidden layer, and an output layer. The hidden layer utilizes radial basis functions to produce a non-linear output.

Usage

MATLAB provides a built-in RBF Network function called newrb. Here's how to use it:

% create inputs and targets
x = -5:0.1:5;
y = sin(x);
inputs = x;
targets = y;

% create RBF Network
hiddenLayerSize = 10;
net = newrb(inputs, targets, 0, 1, hiddenLayerSize, 1);

% simulate network
outputs = net(inputs);

% plot results
plot(inputs,targets,'b',inputs,outputs,'r')
legend('Targets','Outputs')

First, we create the inputs and targets. In this example, we use the sin function to generate the targets.

Next, we use the newrb function to create the RBF Network. The function takes the inputs and targets as inputs, as well as several other parameters. The hiddenLayerSize parameter determines the number of neurons in the hidden layer.

After creating the network, we simulate it by passing the inputs through it using the net function.

Finally, we plot the targets and outputs using the plot function.

Customization

The newrb function provides several parameters for customizing the RBF Network. Here are some of the most important ones:

  • spread: determines the spread of the radial basis functions. A lower value results in more localized functions, while a higher value results in more generalized functions.
  • goal: determines the network's performance goal, which is typically set to a small value.
  • max_fail: determines the maximum number of validation failures before the training is stopped.
  • show: determines how often the training progress is displayed.
Conclusion

The RBF Network is a powerful tool for function approximation and classification. MATLAB provides a convenient way to create and simulate RBF Networks using the newrb function. By customizing the function's parameters, you can optimize the network's performance for your specific task.