|
60 | 60 | 'pad_to_zero_dxdt': {True, False}, |
61 | 61 | 'high_freq_cutoff': [1e-3, 5e-2, 1e-2, 5e-2, 1e-1]}, # give numerical params in a list to scipy.optimize over them |
62 | 62 | {'high_freq_cutoff': (1e-5, 1-1e-5)}), |
63 | | - rbfdiff: ({'sigma': [1e-3, 1e-2, 1e-1, 1], |
| 63 | + rbfdiff: ({'sigma': [1e-2, 1e-1, 1], |
64 | 64 | 'lmbd': [1e-3, 1e-2, 1e-1]}, |
65 | | - {'sigma': (1e-3, 1e3), |
66 | | - 'lmbd': (1e-4, 0.5)}), |
| 65 | + {'sigma': (1e-2, 1e3), |
| 66 | + 'lmbd': (1e-3, 0.5)}), |
67 | 67 | tvrdiff: ({'gamma': [1e-2, 1e-1, 1, 10, 100, 1000], |
68 | 68 | 'order': {1, 2, 3}}, # warning: order 1 hacks the loss function when tvgamma is used, tends to win but is usually suboptimal choice in terms of true RMSE |
69 | 69 | {'gamma': (1e-4, 1e7)}), |
|
81 | 81 | rtsdiff: ({'forwardbackward': {True, False}, |
82 | 82 | 'order': {1, 2, 3}, # for this few options, the optimization works better if this is categorical |
83 | 83 | 'log_qr_ratio': [float(k) for k in range(-9, 10, 2)] + [12, 16]}, |
84 | | - {'log_qr_ratio': [-10, 20]}), # qr_ratio is usually >>1 |
| 84 | + {'log_qr_ratio': (-10, 20)}), # qr_ratio is usually >>1 |
85 | 85 | constant_velocity: ({'q': [1e-8, 1e-4, 1e-1, 1e1, 1e4, 1e8], # Deprecated method |
86 | 86 | 'r': [1e-8, 1e-4, 1e-1, 1e1, 1e4, 1e8], |
87 | 87 | 'forwardbackward': {True, False}}, |
88 | 88 | {'q': (1e-10, 1e10), |
89 | 89 | 'r': (1e-10, 1e10)}), |
90 | | - # robustdiff: ({'order': {1, 2, 3}, # warning: order 1 hacks the loss function when tvgamma is used, tends to win but is usually suboptimal choice in terms of true RMSE |
91 | | - # 'log_q': [1., 4, 8, 12], # decimal after first entry ensure this is treated as float type |
92 | | - # 'log_r': [-1., 1, 4, 8], |
93 | | - # #'proc_huberM': [0., 2, 6], # 0 is l1 norm, 1.345 is Huber 95% "efficiency", 2 assumes about 5% outliers, |
94 | | - # 'meas_huberM': [0., 2, 6]}, # and 6 assumes basically no outliers -> l2 norm. Try (1 - norm.cdf(M))*2 to see outlier portion |
95 | | - # {'log_q': (-1, 18), |
96 | | - # 'log_r': (-5, 18), |
97 | | - # 'proc_huberM': (0, 6), |
98 | | - # 'meas_huberM': (0, 6)}), |
99 | 90 | robustdiff: ({'order': {1, 2, 3}, # warning: order 1 hacks the loss function when tvgamma is used, tends to win but is usually suboptimal choice in terms of true RMSE |
100 | | - 'log_q': [1., 4, 8, 12], # decimal after first entry ensure this is treated as float type |
101 | | - 'log_r': [-1., 1, 4, 8], |
102 | | - #'qr_ratio': [10**k for k in range(-1, 16, 4)], |
103 | | - 'huberM': [0., 5, 10]}, # 0. so type is float. Good choices here really depend on the data scale |
104 | | - {'log_q': (0, 18), |
105 | | - 'log_r': (-5, 10), |
106 | | - 'huberM': (0, 20)}), # really only want to use quadratic when nearby; 20sigma is a huge distance |
| 91 | + 'log_q': [1., 4, 7, 10, 13], # decimal after first entry ensure this is treated as float type |
| 92 | + 'log_r': [-1., 2, 5, 8, 11], |
| 93 | + 'proc_huberM': [0., 2, 6], # 0 is l1 norm, 1.345 is Huber 95% "efficiency", 2 assumes about 5% outliers, |
| 94 | + 'meas_huberM': [0., 2, 6]}, # 6 assumes basically no outliers per outlier_portion = (1 - norm.cdf(M))*2 |
| 95 | + {'log_q': (-5, 16), |
| 96 | + 'log_r': (-5, 16), |
| 97 | + 'proc_huberM': (0, 6), |
| 98 | + 'meas_huberM': (0, 6)}), |
107 | 99 | lineardiff: ({'kernel': 'gaussian', |
108 | 100 | 'order': 3, |
109 | 101 | 'gamma': [1e-1, 1, 10, 100], |
@@ -161,7 +153,8 @@ def _objective_function(point, func, x, dt, singleton_params, categorical_params |
161 | 153 | ec = evaluate.error_correlation(dxdt_truth, dxdt_hat, padding=padding) |
162 | 154 | cache[key] = ec; return ec |
163 | 155 | else: # then minimize sqrt{2*Mean(Huber((x_hat- x)/sigma))}*sigma + gamma*TV(dxdt_hat) |
164 | | - cost = evaluate.robust_rme(x, x_hat, padding=padding) + tvgamma*evaluate.total_variation(dxdt_hat, padding=padding) |
| 156 | + # Huber M=2 means more than 95% of inliers (assuming Gaussianity) are treated with RMSE, while |
| 157 | + cost = evaluate.robust_rme(x, x_hat, padding=padding, M=2) + tvgamma*evaluate.total_variation(dxdt_hat, padding=padding) |
165 | 158 | cache[key] = cost; return cost |
166 | 159 |
|
167 | 160 |
|
|
0 commit comments