summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-04-11 15:43:54 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2019-04-11 15:44:49 +0100
commite80f8c108871245f06dc3e570502e95a4acba64b (patch)
treed4418e30ef0db104f91ee3731c98dae7789f3e0d /Wrappers/Python
parent1dec48d390df5cbc3436832cedf559b64f4651bc (diff)
downloadframework-e80f8c108871245f06dc3e570502e95a4acba64b.tar.gz
framework-e80f8c108871245f06dc3e570502e95a4acba64b.tar.bz2
framework-e80f8c108871245f06dc3e570502e95a4acba64b.tar.xz
framework-e80f8c108871245f06dc3e570502e95a4acba64b.zip
clean code
closes #240
Diffstat (limited to 'Wrappers/Python')
-rwxr-xr-xWrappers/Python/ccpi/optimisation/functions/MixedL21Norm.py23
1 files changed, 2 insertions, 21 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/functions/MixedL21Norm.py b/Wrappers/Python/ccpi/optimisation/functions/MixedL21Norm.py
index c6b6e95..a655e03 100755
--- a/Wrappers/Python/ccpi/optimisation/functions/MixedL21Norm.py
+++ b/Wrappers/Python/ccpi/optimisation/functions/MixedL21Norm.py
@@ -99,27 +99,8 @@ class MixedL21Norm(Function):
else:
res1 = functools.reduce(lambda a,b: a + b*b, x.containers, x.get_item(0) * 0 )
res = res1.sqrt().maximum(1.0)
-
- if False:
- # works but not memory efficient as allocating a new BlockDataContainer
- a = x / res
- out.fill(a)
- elif False:
- # this leads to error
-# File "ccpi\framework\BlockDataContainer.py", line 142, in divide
-# return type(self)(*[ el.divide(other, *args, **kwargs) for el in self.containers], shape=self.shape)
-# File "ccpi\framework\BlockDataContainer.py", line 142, in <listcomp>
-# return type(self)(*[ el.divide(other, *args, **kwargs) for el in self.containers], shape=self.shape)
-# File "ccpi\framework\framework.py", line 814, in divide
-# return self.pixel_wise_binary(numpy.divide, other, *args, **kwargs)
-# File "ccpi\framework\framework.py", line 802, in pixel_wise_binary
-# raise ValueError (message(type(self), "incompatible class:" , pwop.__name__, type(out)))
-# ValueError: ImageData: incompatible class: true_divide <class 'ccpi.framework.BlockDataContainer.BlockDataContainer'>
- x.divide(res, out=out)
- else:
- for i,el in enumerate(x.containers):
- #a = out.get_item(i)
- el.divide(res, out=out.get_item(i))
+ for i,el in enumerate(x.containers):
+ el.divide(res, out=out.get_item(i))
def __rmul__(self, scalar):
return ScaledFunction(self, scalar)