Changeset 1118
- Timestamp:
- 07/12/08 05:17:19 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openopt/scikits/openopt/examples/checkDerivatives.py
r1116 r1118 49 49 p.checkdh(x=myX, maxViolation=1e-4) 50 50 51 Note:52 RD is log10 of "relative difference" and is defined as int(ceil(log10( |info_user-info_numerical| / (|info_user|+|info_numerical+1e-15))))53 54 51 ################################################################################# 55 52 Typical output (unfortunately, in terminal or other IDEs the blank space used in strings separation can have other lengths): 53 Note that RD (relative difference) is defined as 54 int(ceil(log10(abs(Diff) / maxViolation + 1e-150))) 55 where 56 Diff = 1 - (info_user+1e-150)/(info_numerical + 1e-150) 56 57 57 58 OpenOpt checks user-supplied gradient df (shape: (30,) ) 58 according to: 59 prob.diffInt = [9.9999999999999995e-08] 60 lines with |info_user-info_numerical| / (|info_user|+|info_numerical+1e-15) greater than maxViolation = 0.01 will be shown 59 according to prob.diffInt = [9.9999999999999995e-08] 60 lines with 1 - info_user/info_numerical greater than maxViolation = 0.01 will be shown 61 61 df num user-supplied numerical RD 62 0 +7.000e+00 -8.000e+00 262 0 +7.000e+00 -8.000e+00 3 63 63 8 -2.291e+00 -1.029e+01 2 64 64 max(abs(df_user - df_numerical)) = 14.9999995251 … … 66 66 ======================== 67 67 OpenOpt checks user-supplied gradient dc (shape: (2, 30) ) 68 according to: 69 prob.diffInt = [9.9999999999999995e-08] 70 lines with |info_user-info_numerical| / (|info_user|+|info_numerical+1e-15) greater than maxViolation = 0.01 will be shown 68 according to prob.diffInt = [9.9999999999999995e-08] 69 lines with 1 - info_user/info_numerical greater than maxViolation = 0.01 will be shown 71 70 dc num i,j:dc[i]/dx[j] user-supplied numerical RD 72 32 1 / 2 +1.417e+01 -8.323e-01 271 32 1 / 2 +1.417e+01 -8.323e-01 4 73 72 max(abs(dc_user - dc_numerical)) = 14.9999999032 74 73 (is registered in dc number 32) 75 74 ======================== 76 75 OpenOpt checks user-supplied gradient dh (shape: (2, 30) ) 77 according to: 78 prob.diffInt = [9.9999999999999995e-08] 79 lines with |info_user-info_numerical| / (|info_user|+|info_numerical+1e-15) greater than maxViolation = 0.01 will be shown 76 according to prob.diffInt = [9.9999999999999995e-08] 77 lines with 1 - info_user/info_numerical greater than maxViolation = 0.01 will be shown 80 78 dh num i,j:dh[i]/dx[j] user-supplied numerical RD 81 79 58 1 / 28 -4.474e+01 -5.974e+01 2
