function mse_calc = mse_test(x, net, inputs, targets) net = setwb(net, x'); y = net(inputs); mse_calc = sum((y-targets).^2)/length(y);endinputs = (1:10);targets = cos(inputs.^2);n = 2;net = feedforwardnet(n);net = configure(net, inputs, targets);h = @(x) mse_test(x, net, inputs, targets);ga_opts = gaoptimset('TolFun', 1e-8,'display','iter');[x_ga_opt, err_ga] = ga(h, 3*n+1, ga_opts);
MATLAB: What does this command: “@(x) Function” means in matlab
@anonymous function
Related Question
- How do i optimize weights of neural network using GA in MATLAB(need codes to achieve that), again how do i call this function that optimzes the neural network weights in GA GUI so i can work with it from the interface
- I want to optimize a neural network parameters by genetic algorithm and i get below code from matlab support, but the result is very poor even for a very simple function. how can i improve the result and is there any better code for the porpuse
- Error in creating a function
- How to optimize patternnet using a genetic algorithm
- It gives worse results when I use Genetic Algorithm for training NNs than when I use Back-propagation
- To optimize a neural network by giving 46*3 inputs from excel and getting 46*1 output using a genetic algorithm
Best Answer