Commit 75169397 authored by jansen31's avatar jansen31
Browse files

documentation

parent 1314e004
......@@ -11,18 +11,21 @@
from .SimpleAlgortihm import SimpleAlgorithm
from numpy import exp
class RAAR(SimpleAlgorithm):
def evaluate(self, u):
iter = self.config['iter']+1 #add 1 to conform with matlab version (iter influences beta and we sometimes want to compare results between python and matlab), matlab counts starting at 1, python starts at 0
beta0 = self.config['beta_0']
beta_max = self.config['beta_max']
beta_switch = self.config['beta_switch']
tmp1 = 2*self.prox2.work(u)-u
tmp2 = self.prox1.work(tmp1)
iter = self.config['iter'] + 1
# add 1 to conform with matlab version (iter influences beta and we sometimes want to compare results between
# python and matlab), matlab counts starting at 1, python starts at 0
beta0 = self.config['beta_0'] # Initial beta value for first iterations
beta_max = self.config['beta_max'] # Final beta value for later iterations
beta_switch = self.config['beta_switch'] # Timescale over which to change beta
tmp1 = 2 * self.prox2.work(u) - u # Reflection using prox2 on u
tmp2 = self.prox1.work(tmp1) # Projection of the reflection
# update
beta = exp((-iter/beta_switch)**3)*beta0+(1-exp((-iter/beta_switch)**3))*beta_max # unrelaxes as the
unew = (beta*(2*tmp2-tmp1) + (1-beta)*tmp1 + u)/2
beta = exp((-iter / beta_switch) ** 3) * beta0 + (
1 - exp((-iter / beta_switch) ** 3)) * beta_max # gradually changes beta from beta0 into beta_max
unew = (beta * (2 * tmp2 - tmp1) + (1 - beta) * tmp1 + u) / 2
# unew = (beta * Reflection(Reflection(u)) + (1-beta)* Reflection(u) + u ) / 2
return unew
......@@ -83,7 +83,7 @@ class RAAR_expert(Algorithm):
change[0] = 999
gap = change.copy()
shadow_change = change.copy()
if hasattr(self, 'truth'):
if hasattr(self, 'truth'):
Relerrs = change.copy()
tmp1 = 2*self.prox2.work(u) - u
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment