Permalink
Browse files

modifed reg terms: divanticurl, hessian, shear to not use dualpart an…

…ymore; regenerated UML; added more abstract methods to basicOperator
  • Loading branch information...
LarsHaalck committed Mar 31, 2017
1 parent 06bfa9c commit b3f39bbd79627aed89ed7a2ec605cb550214c83b

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,31 +1,23 @@
Data Terms
#basics
primalPart.m
dualPart.m
#terms
basicTerm.m
basicDualizedDataterm.m
basicOpticalFlow.m
emptyDataTerm.m
emptyTermMinMax.m
huberDataTerm.m
huberDataTermOperator.m
KLdataTermOperator.m
L1dataTerm.m
#L1dataTermOld.m
L1dataTermOperator.m
L1opticalFlowTerm.m
L2dataTerm.m
#L2dataTermOld.m
L2dataTermOperator.m
L2opticalFlowTerm.m
labelingTerm.m
#tilde
tildeMultiOperatorMultiDual.m
#proxs
IdentityProxPrimal.m
MinMaxProxPrimal.m
basicProx.m
HuberDataProxDual.m
KLDataProxDual.m
L1DataProxDual.m
L1HuberDataProxDual.m
L2DataProxDual.m
labelingProxDual.m
@@ -4,7 +4,6 @@ basicOperator.m
concatOperator.m
convolutionOperator.m
diagonalOperator.m
downsamplingOperator.m
functionHandleOperator.m
gradientOperator.m
identityOperator.m

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,11 @@
Regularizer Terms (constraint)
#terms
basicTerm.m
basicDualizedOperator.m
boxConstraint.m
nonNegativityConstraint.m
nonNegativityConstraintOperator.m
#proxs
basicProx.m
constraintBoxDualized
@@ -1,28 +1,30 @@
Regularizer Terms (Gradient)
#basics
dualPart.m
Regularizer Terms (gradient)
#terms
basicTerm.m
basicDualizedOperator.m
basicGradient.m
basicGradientDifference.m
basicSecondOrderGradient.m
frobeniusGradient.m
huberGradient.m
innerProductGradient.m
innerProductGradientDiff.m
L1gradientAniso.m
L1gradientDiffAniso.m
L1gradientDiffIso.m
L1gradientIso.m
L1plusInnerProductGradient.m
L1plusInnerProductGradientDifference.m
L1secondOrderGradientAniso.m
L1secondOrderGradientIso.m
L2gradient.m
#tilde
tildeMultiOperatorMultiDual.m
#proxs
basicProx.m
FrobeniusProxDual.m
L1HuberProxDual.m
HuberProxDual.m
innerProductProxDual.m
L1AnisoProxDual.m
L1IsoProxDual.m
L1IsoProxDualShift.m
L2proxDual.m
@@ -1,8 +1,6 @@
Regularizer Terms (Hessian / Laplace)
#basics
dualPart.m
Regularizer Terms (hessian / laplace)
#terms
basicTerm.m
basicDualizedOperator.m
basicHessian.m
basicLaplace.m
@@ -11,10 +9,7 @@ L1laplace.m
L2hessian.m
L2laplace.m
#tilde
tildeMultiOperatorMultiDual.m
#proxs
basicProx.m
L1AnisoProxDual.m
L2proxDual.m
@@ -1,10 +1,7 @@
Regularizer Terms (General Operator)
#basics
dualPart.m
Regularizer Terms (operators)
#terms
basicTerm.m
basicDualizedOperator.m
frobeniusOperator.m
huberOperator.m
innerProductOperator.m
@@ -13,12 +10,10 @@ L1operatorIso.m
L2operator.m
#tilde
tildeMultiOperatorMultiDual.m
#proxs
basicProx.m
FrobeniusProxDual.m
L1HuberProxDual.m
HuberProxDual.m
innerProductProxDual.m
L1AnisoProxDual.m
L1IsoProxDual.m
@@ -1,25 +1,12 @@
Regularizer Terms (Other)
#basics
dualPart.m
Regularizer Terms (other)
#terms
basicTerm.m
basicDualizedOperator.m
basicIdentity.m
basicGradient.m
basicGradientDifference.m
innerProductGradient.m
innerProductGradientDiff.m
L1plusInnerProductGradient.m
L1plusInnerProductGradientDifference.m
L1identity.m
L2identity.m
#tilde
tildeMultiOperatorMultiDual.m
#proxs
innerProductProxDual.m
basicProx.m
L1AnisoProxDual.m
L2proxDual.m
L1IsoProxDualShift.m
@@ -1,13 +1,11 @@
Regularizer Terms (Vector-field)
#basics
dualPart.m
Regularizer Terms (vector field)
#terms
basicTerm.m
basicDualizedOperator.m
basicCurl.m
basicDivAnticurl.m
basicDivergence.m
basicDivCurl.m
basicDivergence.m
basicShear.m
L1curl.m
L1curlPlus.m
@@ -21,10 +19,8 @@ L2curl.m
L2divergence.m
L2shear.m
#tilde
tildeMultiOperatorMultiDual.m
#proxs
basicProx.m
L1AnisoProxDual.m
L1IsoProxDual.m
L2proxDual.m
@@ -45,4 +45,4 @@
result = result + main.getPrimal(i) * labels(i);
end
figure(2);imagesc(result);axis image;title('Result')
figure(2);imagesc(result);axis image;colormap(gray);colorbar;title('Result')
@@ -8,29 +8,31 @@
properties
isMinus
end
methods (Abstract)
abs(obj)
ctranspose(obj)
getMaxRowSumAbs(obj)
getRowSumAbs(obj)
mtimes(obj,vector)
returnMatrix(obj)
size(obj,dim)
getMaxRowSumAbs(obj)
getRowSumAbs(obj)
end
methods
function result = uminus(obj)
result = obj;
result.isMinus = ~result.isMinus;
end
function uplus(obj)
error('You cannot use plus with operator classes. Please use concatOperator instead!')
end
function plus(obj,B)
error('You cannot use plus with operator classes. Please use concatOperator instead!')
end
function minus(obj,B)
error('You cannot use minus with operator classes. Please use concatOperator instead!')
end
@@ -1,7 +1,7 @@
%represents base class for terms containing the operator
%K(u,v) = [u_x + v_y;u_x - v_y]
%corresponds to two primal variables (u,v)
classdef basicDivAnticurl < dualPart
classdef basicDivAnticurl < basicDualizedOperator
properties
end
@@ -18,58 +18,15 @@
opTmp = generateForwardGradientND( dims,ones(numel(dims),1) );
end
obj = obj@dualPart(alpha);
obj.numVars = 2; %divergence produces scalar quantity
for i=1:numel(dims)
obj.length{i} = prod(dims);
obj.operator{i} = opTmp( (i-1)*prod(dims) + 1 : i * prod(dims),: )';
obj.myTau{i} = 2;
operatorList{i} = opTmp( (i-1)*prod(dims) + 1 : i * prod(dims),: )';
end
obj.mySigma{1} = 2*numel(dims);
obj.mySigma{2} = 2*numel(dims);
obj.operator{3} = obj.operator{1};
obj.operator{4} = -obj.operator{2};
end
function yTilde(obj,main,dualNumbers,primalNumbers)
for i=1:numel(dualNumbers)
main.yTilde{dualNumbers(i)} = main.y{dualNumbers(i)};
end
for i=1:numel(dualNumbers)
for j=1:2
operatorNumber = 2*(i-1) + j;
main.yTilde{dualNumbers(i)} = main.yTilde{dualNumbers(i)} + main.params.sigma{dualNumbers(i)} * (obj.operator{operatorNumber}* main.xBar{primalNumbers(j)});
end
end
end
operatorList{3} = operatorList{1};
operatorList{4} = -operatorList{2};
function xTilde(obj,main,dualNumbers,primalNumbers)
for i=1:numel(primalNumbers)
for j=1:2
operatorNumber = 2*(j-1) + i;
main.xTilde{primalNumbers(i)} = main.xTilde{primalNumbers(i)} - main.params.tau{primalNumbers(i)}*(obj.operator{operatorNumber}' * main.y{dualNumbers(j)});
end
end
end
function yError(obj,main,dualNumbers,primalNumbers)
for i=1:numel(dualNumbers)
for j=1:2
operatorNumber = 2*(i-1) + j;
main.yError{dualNumbers(i)} = main.yError{dualNumbers(i)} - obj.operator{operatorNumber}* (main.xOld{primalNumbers(j)}-main.x{primalNumbers(j)});
end
end
obj = obj@basicDualizedOperator(alpha, numel(operatorList), operatorList, varargin);
end
function xError(obj,main,dualNumbers,primalNumbers)
for i=1:numel(primalNumbers)
for j=1:2
operatorNumber = 2*(j-1) + i;
main.xError{primalNumbers(i)} = main.xError{primalNumbers(i)} - obj.operator{operatorNumber}' * (main.yOld{dualNumbers(j)}-main.y{dualNumbers(j)});
end
end
end
end
end
Oops, something went wrong.

0 comments on commit b3f39bb

Please sign in to comment.