@@ -233,14 +233,17 @@ def generate_true(i):
233233 ###############
234234
235235 #slope of line y = mx
236- m = 1e5
236+ m = 15000 * 1e3
237237 mask_on_axis = m * np .abs (coord [0 ]) >= np .abs (coord [1 ])
238238 mask_off_axis = m * np .abs (coord [0 ]) < np .abs (coord [1 ])
239239
240240 print ("-------------------------" )
241241
242+ percent_on = np .sum (mask_on_axis )/ (mask_on_axis .shape [0 ]* mask_on_axis .shape [1 ])
243+ percent_off = 1 - percent_on
244+
242245 relerr_on = np .abs (interactions_on_axis [mask_on_axis ]- interactions_true [mask_on_axis ])/ np .abs (interactions_on_axis [mask_on_axis ])
243- print ("MAX ON AXIS ERROR:" , np .max (relerr_on ))
246+ print ("MAX ON AXIS ERROR(" , percent_on , ") :" , np .max (relerr_on ))
244247 print (np .mean (relerr_on ))
245248 print ("X:" , coord [0 ].reshape (- 1 )[np .argmax (relerr_on )])
246249 print ("Y:" , coord [1 ].reshape (- 1 )[np .argmax (relerr_on )])
@@ -249,7 +252,7 @@ def generate_true(i):
249252
250253 if np .any (mask_off_axis ):
251254 relerr_off = np .abs (interactions_off_axis [mask_off_axis ]- interactions_true [mask_off_axis ])/ np .abs (interactions_off_axis [mask_off_axis ])
252- print ("MAX OFF AXIS ERROR:" , np .max (relerr_off ))
255+ print ("MAX OFF AXIS ERROR(" , percent_off , ") :" , np .max (relerr_off ))
253256 print (np .mean (relerr_off ))
254257 print ("X:" , coord [0 ].reshape (- 1 )[np .argmax (relerr_off )])
255258 print ("Y:" , coord [1 ].reshape (- 1 )[np .argmax (relerr_off )])
@@ -259,5 +262,9 @@ def generate_true(i):
259262 interactions_total [mask_off_axis ] = interactions_off_axis [mask_off_axis ]
260263
261264 exp_res = (interactions_total * strengths [None , :]).sum (axis = 1 )
265+ exp_res_true = (interactions_true * strengths [None , :]).sum (axis = 1 )
266+
267+ relerr_total = np .max (np .abs (exp_res - exp_res_true )/ np .abs (exp_res_true ))
268+ print ("OVERALL ERROR:" , relerr_total )
262269
263270 return exp_res
0 commit comments