Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 254f70e5 authored by Andi Braimllari's avatar Andi Braimllari Committed by Tobias Lasser
Browse files

SplittingProblem now supports different DomainDescriptors in data and regularization terms

parent c154949a
Pipeline #710105 passed with stages
in 23 minutes and 58 seconds
......@@ -17,13 +17,6 @@ namespace elsa
if (_dataTerm->getDomainDescriptor().getNumberOfCoefficients()
!= this->_currentSolution.getSize())
throw InvalidArgumentError("Problem: domain of dataTerm and solution do not match");
for (auto& regTerm : _regTerms) {
if (dataTerm.getDomainDescriptor().getNumberOfCoefficients()
!= regTerm.getFunctional().getDomainDescriptor().getNumberOfCoefficients())
throw InvalidArgumentError(
"Problem: one of the reg terms' domain does not match the data term's");
}
}
template <typename data_t>
......@@ -35,14 +28,6 @@ namespace elsa
_currentSolution{dataTerm.getDomainDescriptor()},
_lipschitzConstant{lipschitzConstant}
{
// sanity check
for (auto& regTerm : _regTerms) {
if (dataTerm.getDomainDescriptor().getNumberOfCoefficients()
!= regTerm.getFunctional().getDomainDescriptor().getNumberOfCoefficients())
throw InvalidArgumentError(
"Problem: one of the reg terms' domain does not match the data term's");
}
_currentSolution = 0;
}
......@@ -60,11 +45,6 @@ namespace elsa
if (_dataTerm->getDomainDescriptor().getNumberOfCoefficients()
!= this->_currentSolution.getSize())
throw InvalidArgumentError("Problem: domain of dataTerm and solution do not match");
if (dataTerm.getDomainDescriptor().getNumberOfCoefficients()
!= regTerm.getFunctional().getDomainDescriptor().getNumberOfCoefficients())
throw InvalidArgumentError(
"Problem: one of the reg terms' domain does not match the data term's");
}
template <typename data_t>
......@@ -76,12 +56,6 @@ namespace elsa
_currentSolution{dataTerm.getDomainDescriptor(), defaultHandlerType},
_lipschitzConstant{lipschitzConstant}
{
// sanity check
if (dataTerm.getDomainDescriptor().getNumberOfCoefficients()
!= regTerm.getFunctional().getDomainDescriptor().getNumberOfCoefficients())
throw InvalidArgumentError(
"Problem: one of the reg terms' domain does not match the data term's");
_currentSolution = 0;
}
......
......@@ -221,6 +221,25 @@ TEST_CASE("Problem: Testing with one regularization term")
REQUIRE_UNARY(checkApproxEq(prob.getLipschitzConstant(100), 1.0f + weight));
}
}
WHEN("given a different data descriptor and another regularization term with a different "
"domain descriptor")
{
// three-dimensional data descriptor
IndexVector_t otherNumCoeff(3);
otherNumCoeff << 15, 38, 22;
VolumeDescriptor otherDD(otherNumCoeff);
// l2 norm regularization term
L2NormPow2 otherRegFunc(otherDD);
RegularizationTerm otherRegTerm(weight, otherRegFunc);
THEN("no exception is thrown when setting up a problem with different domain "
"descriptors")
{
REQUIRE_NOTHROW(Problem{func, otherRegTerm});
}
}
}
}
......@@ -335,6 +354,34 @@ TEST_CASE("Problem: Testing with several regularization terms")
checkApproxEq(prob.getLipschitzConstant(100), 1.0f + weight1 + weight2));
}
}
WHEN("given two different data descriptors and two regularization terms with a different "
"domain descriptor")
{
// three-dimensional data descriptor
IndexVector_t otherNumCoeff(3);
otherNumCoeff << 15, 38, 22;
VolumeDescriptor otherDD(otherNumCoeff);
// four-dimensional data descriptor
IndexVector_t anotherNumCoeff(4);
anotherNumCoeff << 7, 9, 21, 17;
VolumeDescriptor anotherDD(anotherNumCoeff);
// l2 norm regularization term
L2NormPow2 otherRegFunc(otherDD);
RegularizationTerm otherRegTerm(weight1, otherRegFunc);
// l2 norm regularization term
L2NormPow2 anotherRegFunc(anotherDD);
RegularizationTerm anotherRegTerm(weight2, anotherRegFunc);
THEN("no exception is thrown when setting up a problem with different domain "
"descriptors")
{
REQUIRE_NOTHROW(Problem{func, std::vector{otherRegTerm, anotherRegTerm}});
}
}
}
}
......
Markdown is supported
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