Changeset b514adf in sasmodels
 Timestamp:
 Nov 24, 2015 3:43:22 PM (8 years ago)
 Branches:
 master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket1257vesicleproduct, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
 Children:
 92da231
 Parents:
 062c56d
 Location:
 sasmodels
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

sasmodels/compare.py
r5753e4e rb514adf 130 130 if name == 'capped_cylinder' and pars['cap_radius'] < pars['radius']: 131 131 pars['radius'],pars['cap_radius'] = pars['cap_radius'],pars['radius'] 132 if name == 'barbell' and pars['bell_radius'] < pars['radius']: 133 pars['radius'],pars['bell_radius'] = pars['bell_radius'],pars['radius'] 134 135 # Limit guinier to an Rg such that Iq > 1e30 (single precision cutoff) 136 if name == 'guinier': 137 #q_max = 0.2 # mid q maximum 138 q_max = 1.0 # high q maximum 139 rg_max = np.sqrt(90*np.log(10) + 3*np.log(pars['scale']))/q_max 140 pars['rg'] = min(pars['rg'],rg_max) 132 141 133 142 # These constraints are only needed for comparison to sasview … … 247 256 seed = int(opt_values['random']) if 'random' in opt_values else None 248 257 pars, seed = randomize_model(pars, seed=seed) 249 constrain_pars(model_definition, pars)250 258 print "Randomize using random=%i"%seed 251 259 pars.update(set_pars) # set value after random to control value 260 constrain_pars(model_definition, pars) 252 261 253 262 # parameter selection 
sasmodels/compare_many.py
rcd3dba0 rb514adf 57 57 num_good = 0 58 58 first = True 59 max_diff = 0 59 60 for k in range(N): 60 61 print >>sys.stderr, name, k … … 73 74 columns.extend(stats) 74 75 labels.append('GPU single') 75 good = good and (stats[0] < 1e14) 76 max_diff = max(max_diff, stats[0]) 77 good = good and (stats[0] < 5e5) 76 78 if 0 and environment().has_double: 77 79 gpu_double_value = trymodel(eval_opencl, dtype='double', cutoff=cutoff) … … 79 81 columns.extend(stats) 80 82 labels.append('GPU double') 81 good = good and (stats[0] < 1e14) 83 max_diff = max(max_diff, stats[0]) 84 good = good and (stats[0] < 1e12) 82 85 if 1: 83 86 cpu_double_value = trymodel(eval_ctypes, dtype='double', cutoff=cutoff) … … 85 88 columns.extend(stats) 86 89 labels.append('CPU double') 87 good = good and (stats[0] < 1e14) 90 max_diff = max(max_diff, stats[0]) 91 good = good and (stats[0] < 1e12) 88 92 if 0: 89 93 stats = get_stats(cpu_double_value, gpu_single_value, index) 90 94 columns.extend(stats) 91 95 labels.append('single/double') 92 good = good and (stats[0] < 1e14) 96 max_diff = max(max_diff, stats[0]) 97 good = good and (stats[0] < 5e5) 93 98 94 99 columns += [v for _,v in sorted(pars_i.items())] … … 100 105 else: 101 106 print(("%d,"%seed)+','.join("%g"%v for v in columns)) 102 print '" %d/%d good"'%(num_good, N)107 print '"good","%d/%d","max diff",%g'%(num_good, N, max_diff) 103 108 104 109
Note: See TracChangeset
for help on using the changeset viewer.