function [J,G]=fisher_gopt_J(h_,w,m_x1,m_x2,r_xx1,r_xx2,M_h,N_h,IntermSaveProb)
% fisher_gopt_J
%	Calculate -J_fisher(h)
% 

h=reshape(h_,N_h,M_h)';

[m_1,var_1]=fstats(m_x1,r_xx1,h,w);
[m_2,var_2]=fstats(m_x2,r_xx2,h,w);

J=-(m_1 - m_2)^2 / (var_1 + var_2);

if exist('IntermSaveProb')~=1
  IntermSaveProb=0;
end
if rand<=IntermSaveProb
  save fisher_gopt_h.mat h J
end


G=(1-norm(h_)^2);
