public static double weight_change_ratio(double[] w1, double[] w2) throws Exception
	{
		if(w1==null)
			{
			w1=new double[w2.length];
			for(int i=0;i<w1.length;i++)
				w1[i]=0;
			}
		double w_neg=0.0;
		double w_pos=0.0;
		for(int i=0;i<w1.length&&i<w2.length;i++)
		{
			double w_temp=(w2[i]-w1[i])*w1[i];
			if(w_temp<0)
				w_neg+=w_temp*w_temp;
			else
				w_pos+=w_temp*w_temp;
		}
		return w_neg/(w_neg+w_pos);
	}