Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
xerus
xerus
Commits
c145d622
Commit
c145d622
authored
Jun 25, 2020
by
Philipp Trunschke
Browse files
bugfixes, improved efficiency, better IO
parent
ebb92da9
Pipeline
#2111
failed with stages
in 4 minutes and 12 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
include/xerus/applications/uqSALSA.h
View file @
c145d622
...
...
@@ -45,6 +45,7 @@ namespace xerus { namespace uq {
std
::
pair
<
size_t
,
size_t
>
validationSet
;
double
valueNorm_trainingSet
;
double
valueNorm_validationSet
;
std
::
vector
<
std
::
vector
<
Tensor
>>
leftLHSStack
;
// contains successive contractions of x.T@A.T@A@x
std
::
vector
<
std
::
vector
<
Tensor
>>
leftRHSStack
;
// contains successive contractions of x.T@A.T@b
...
...
@@ -88,6 +89,12 @@ namespace xerus { namespace uq {
/* // Reweighting parameters */
/* std::vector<double> weights; */
double
initialResidual
;
//TODO: rename
size_t
bestIteration
;
TTTensor
bestX
;
double
bestTrainingResidual
;
double
bestValidationResidual
;
SALSA
(
const
TTTensor
&
_x
,
const
std
::
vector
<
Tensor
>&
_measures
,
const
Tensor
&
_values
);
void
run
();
...
...
@@ -97,7 +104,8 @@ namespace xerus { namespace uq {
void
calc_left_stack
(
const
size_t
_position
);
void
calc_right_stack
(
const
size_t
_position
);
void
adapt_rank
(
Tensor
&
_U
,
Tensor
&
_S
,
Tensor
&
_Vt
,
const
size_t
_maxRank
,
const
double
_threshold
)
const
;
double
residual
(
const
std
::
pair
<
size_t
,
size_t
>
_slice
)
const
;
double
residual
(
const
std
::
pair
<
size_t
,
size_t
>&
_slice
)
const
;
double
slow_residual
(
const
std
::
pair
<
size_t
,
size_t
>&
_slice
)
const
;
Tensor
omega_operator
()
const
;
Tensor
alpha_operator
()
const
;
void
solve_local
();
...
...
src/xerus/applications/uqSALSA.cpp
View file @
c145d622
This diff is collapsed.
Click to expand it.
src/xerus/python/recovery.cpp
View file @
c145d622
...
...
@@ -154,5 +154,29 @@ void expose_recoveryAlgorithms(module& m) {
.
value
(
"Hermite"
,
uq
::
PolynomBasis
::
Hermite
)
.
value
(
"Legendre"
,
uq
::
PolynomBasis
::
Legendre
)
;
class_
<
uq
::
SALSA
>
(
m
,
"uqSALSA"
)
.
def
(
init
<
TTTensor
,
std
::
vector
<
Tensor
>
,
Tensor
>
())
.
def_readwrite
(
"controlSetFraction"
,
&
uq
::
SALSA
::
controlSetFraction
)
.
def_readwrite
(
"targetResidual"
,
&
uq
::
SALSA
::
targetResidual
)
.
def_readwrite
(
"minDecrease"
,
&
uq
::
SALSA
::
minDecrease
)
.
def_readwrite
(
"maxIterations"
,
&
uq
::
SALSA
::
maxIterations
)
.
def_readwrite
(
"trackingPeriodLength"
,
&
uq
::
SALSA
::
trackingPeriodLength
)
.
def_readwrite
(
"maxNonImprovingAlphaCycles"
,
&
uq
::
SALSA
::
maxNonImprovingAlphaCycles
)
.
def_readwrite
(
"kmin"
,
&
uq
::
SALSA
::
kmin
)
.
def_readwrite
(
"maxRanks;"
,
&
uq
::
SALSA
::
maxRanks
)
.
def_readwrite
(
"maxIRsteps"
,
&
uq
::
SALSA
::
maxIRsteps
)
.
def_readwrite
(
"IRtolerance"
,
&
uq
::
SALSA
::
IRtolerance
)
.
def_readwrite
(
"sparsityThreshold"
,
&
uq
::
SALSA
::
sparsityThreshold
)
.
def_readwrite
(
"fomega"
,
&
uq
::
SALSA
::
fomega
)
.
def_readwrite
(
"omega_factor"
,
&
uq
::
SALSA
::
omega_factor
)
.
def_readwrite
(
"falpha"
,
&
uq
::
SALSA
::
falpha
)
.
def_readwrite
(
"alpha_factor"
,
&
uq
::
SALSA
::
alpha_factor
)
.
def_readwrite
(
"basisWeights"
,
&
uq
::
SALSA
::
basisWeights
)
.
def
(
"run"
,
&
uq
::
SALSA
::
run
)
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment