localization with monte carlo sampling options
This commit is contained in:
parent
9b175fa506
commit
b7af9e9a76
|
|
@ -40,7 +40,7 @@ def fittingSingle(filepath, args):
|
||||||
best_tx_pwr = None
|
best_tx_pwr = None
|
||||||
best_env_gamma = None
|
best_env_gamma = None
|
||||||
best_rsses = None
|
best_rsses = None
|
||||||
for i in range(1000):
|
for i in range(args.iternum):
|
||||||
result = modelfit_log_gamma(
|
result = modelfit_log_gamma(
|
||||||
rx_locs,
|
rx_locs,
|
||||||
rx_rsses,
|
rx_rsses,
|
||||||
|
|
@ -48,8 +48,8 @@ def fittingSingle(filepath, args):
|
||||||
bounds_gamma=(2, 6),
|
bounds_gamma=(2, 6),
|
||||||
bounds_loc_x=(0, 6.4),
|
bounds_loc_x=(0, 6.4),
|
||||||
bounds_loc_y=(0, 6.4),
|
bounds_loc_y=(0, 6.4),
|
||||||
monte_carlo_sampling=True,
|
monte_carlo_sampling=args.montecarlo,
|
||||||
monte_carlo_sampling_rate=0.8
|
monte_carlo_sampling_rate=args.montecarlo_rate
|
||||||
)
|
)
|
||||||
# unpack
|
# unpack
|
||||||
fit_mse, est_tx_loc, est_tx_pwr, est_env_gamma, est_rsses = result
|
fit_mse, est_tx_loc, est_tx_pwr, est_env_gamma, est_rsses = result
|
||||||
|
|
@ -136,6 +136,27 @@ if __name__ == '__main__':
|
||||||
default=False,
|
default=False,
|
||||||
help='enable visualize'
|
help='enable visualize'
|
||||||
)
|
)
|
||||||
|
p.add_argument(
|
||||||
|
'--montecarlo', '-m',
|
||||||
|
dest='montecarlo',
|
||||||
|
action='store_true',
|
||||||
|
default=False,
|
||||||
|
help='enable monte carlo sampling'
|
||||||
|
)
|
||||||
|
p.add_argument(
|
||||||
|
'--montecarlo-rate', '-mr',
|
||||||
|
dest='montecarlo_rate',
|
||||||
|
type=float,
|
||||||
|
default=0.8,
|
||||||
|
help='if monte carlo sampling enabled, specify the rate (0-1, default 0.8)'
|
||||||
|
)
|
||||||
|
p.add_argument(
|
||||||
|
'--iternum', '-n',
|
||||||
|
dest='iternum',
|
||||||
|
type=int,
|
||||||
|
default=1000,
|
||||||
|
help='num of iterations'
|
||||||
|
)
|
||||||
p.add_argument(
|
p.add_argument(
|
||||||
'--output', '-o',
|
'--output', '-o',
|
||||||
dest='outputfile',
|
dest='outputfile',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue