diff options
author | Kilian Fatras <kilianfatras@dhcp-206-12-52-229.eduroam.wireless.ubc.ca> | 2018-06-25 11:03:44 -0700 |
---|---|---|
committer | Kilian Fatras <kilianfatras@dhcp-206-12-52-229.eduroam.wireless.ubc.ca> | 2018-06-25 11:03:44 -0700 |
commit | 9fecd51c583704e02d3faaef722f0dee52f42359 (patch) | |
tree | f35d7525f6f48f78f6b17df6309f91cc84d5a4f5 /examples/plot_stochastic.py | |
parent | e8cf3cc343c934b7c49d303186cdf226204813b3 (diff) |
fix math operator and log bugs
Diffstat (limited to 'examples/plot_stochastic.py')
-rw-r--r-- | examples/plot_stochastic.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/examples/plot_stochastic.py b/examples/plot_stochastic.py index 6274b4c..b9375d4 100644 --- a/examples/plot_stochastic.py +++ b/examples/plot_stochastic.py @@ -15,6 +15,7 @@ algorithms for descrete and semicontinous measures from the POT library. import matplotlib.pylab as pl import numpy as np import ot +import ot.plot ############################################################################# @@ -88,9 +89,9 @@ M = ot.dist(X_source, Y_target) # results. method = "ASGD" -asgd_pi, log = ot.stochastic.solve_semi_dual_entropic(a, b, M, reg, method, - numItermax, log) -print(log['alpha'], log['beta']) +asgd_pi, log_asgd = ot.stochastic.solve_semi_dual_entropic(a, b, M, reg, method, + numItermax, log=log) +print(log_asgd['alpha'], log_asgd['beta']) print(asgd_pi) ############################################################################# @@ -166,15 +167,16 @@ M = ot.dist(X_source, Y_target) ############################################################################# # -# Call the "SGD" dual method to find the transportation matrix in the semicontinous -# case +# Call the "SGD" dual method to find the transportation matrix in the +# semicontinous case # --------------------------------------------- # # Call ot.solve_dual_entropic and plot the results. -sgd_dual_pi, log = ot.stochastic.solve_dual_entropic(a, b, M, reg, batch_size, - numItermax, lr, log) -print(log['alpha'], log['beta']) +sgd_dual_pi, log_sgd = ot.stochastic.solve_dual_entropic(a, b, M, reg, + batch_size, numItermax, + lr, log=log) +print(log_sgd['alpha'], log_sgd['beta']) print(sgd_dual_pi) ############################################################################# |