Neural network output should be in the form of equation? Or number? In Response Surface Methodology (RSM) either a single order or second order equation can be used as fitness function for PSO. But ANN output for PSO?
PSO the same as the other optimization approaches, is required an objective function to be minimized, therefor you should create a function based on variables you would like to be minimize. see the PSO help for more information.
if PSO has been implemented to find solution with minimum objective function, you should use a measure for error, MSE as Zhongyi suggested. Ali mentioned this point meticulously. If your version of PSO implemented in a way that search to find solutions with maximum objective function, you should use -1 * MSE (or -1 * any other measure for error) as the PSO objective function.
I defined MSE function as fitness function . when I call this function it gives error as np.array is not callable. please help me. if any one have code in in python for NN prediction error minimization.