diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2016-10-27 09:13:10 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2016-10-27 09:13:10 +0200 |
commit | 4563808ee8c867f18fa4c2ecb5c3f0bffa53825d (patch) | |
tree | d9dda142a1daff835f8acd6716326aa75337761a /examples | |
parent | afe642c252c0a838dbc35b3d624f6410e45d4c75 (diff) |
demo optim
Diffstat (limited to 'examples')
-rw-r--r-- | examples/demo_optim_OTreg.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/demo_optim_OTreg.py b/examples/demo_optim_OTreg.py index f12fdc1..9ffb02d 100644 --- a/examples/demo_optim_OTreg.py +++ b/examples/demo_optim_OTreg.py @@ -34,12 +34,13 @@ ot.plot.plot1D_mat(a,b,G0,'OT matrix G0') #%% exampel of regularization with Frobnisu norm def f(G): - return 0.5*np.sum(G**2) + #return 0.5*np.sum(G**2) + return np.sum(G*np.log(G)) def df(G): - return G - -reg=1e1 +# return G + return np.log(G)+1 +reg=1e-3 Greg=ot.optim.cg(a,b,M,reg,f,df,verbose=True) |