Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Eisgenerator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Klemm, Carl Philipp
Eisgenerator
Commits
3d8e4e1e
Commit
3d8e4e1e
authored
1 year ago
by
Carl Philipp Klemm
Browse files
Options
Downloads
Patches
Plain Diff
add multiply add and constant score functions
parent
bba6cede
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
basicmath.cpp
+28
-0
28 additions, 0 deletions
basicmath.cpp
eisgenerator/basicmath.h
+4
-0
4 additions, 0 deletions
eisgenerator/basicmath.h
model.cpp
+8
-0
8 additions, 0 deletions
model.cpp
with
40 additions
and
0 deletions
basicmath.cpp
+
28
−
0
View file @
3d8e4e1e
...
...
@@ -49,6 +49,12 @@ std::complex<fvalue> eis::absGrad(const std::vector<eis::DataPoint>& data, size_
std
::
abs
((
data
[
index
+
1
].
im
.
imag
()
-
data
[
index
-
1
].
im
.
imag
())
/
(
data
[
index
+
1
].
omega
-
data
[
index
-
1
].
omega
)));
}
void
mulitplyAdd
(
std
::
vector
<
eis
::
DataPoint
>&
data
,
fvalue
mult
,
fvalue
add
)
{
for
(
eis
::
DataPoint
&
point
:
data
)
point
.
im
=
point
.
im
*
mult
+
add
;
}
fvalue
eis
::
grad
(
const
std
::
vector
<
fvalue
>&
data
,
const
std
::
vector
<
fvalue
>&
omega
,
size_t
index
)
{
assert
(
data
.
size
()
==
omega
.
size
());
...
...
@@ -197,6 +203,28 @@ fvalue eis::pearsonCorrelation(const std::vector<eis::DataPoint>& data)
return
sumDeltaReDeltaIm
/
(
sqrt
(
sumDeltaReSq
)
*
sqrt
(
sumDeltaImSq
));
}
fvalue
eis
::
nonConstantScore
(
const
std
::
vector
<
eis
::
DataPoint
>&
data
)
{
std
::
complex
<
fvalue
>
meanValue
=
mean
(
data
);
fvalue
reDeviationMax
=
std
::
numeric_limits
<
fvalue
>::
min
();
fvalue
imDeviationMax
=
std
::
numeric_limits
<
fvalue
>::
min
();
for
(
const
eis
::
DataPoint
&
point
:
data
)
{
fvalue
reDeviation
=
1
-
(
std
::
abs
(
point
.
im
.
real
())
/
std
::
abs
(
meanValue
.
real
()));
fvalue
imDeviation
=
1
-
(
std
::
abs
(
point
.
im
.
imag
())
/
std
::
abs
(
meanValue
.
imag
()));
if
(
reDeviationMax
<
reDeviation
)
reDeviationMax
=
reDeviation
;
if
(
imDeviationMax
<
imDeviation
)
imDeviationMax
=
imDeviation
;
}
return
std
::
min
(
reDeviationMax
,
imDeviationMax
);
}
fvalue
eis
::
nyquistAreaVariance
(
const
std
::
vector
<
eis
::
DataPoint
>&
data
,
eis
::
DataPoint
*
centroid
)
{
assert
(
data
.
size
()
>
2
);
...
...
This diff is collapsed.
Click to expand it.
eisgenerator/basicmath.h
+
4
−
0
View file @
3d8e4e1e
...
...
@@ -30,6 +30,8 @@ namespace eis
* @{
*/
void
mulitplyAdd
(
std
::
vector
<
eis
::
DataPoint
>&
data
,
fvalue
mult
,
fvalue
add
);
/**
* @brief Calculates the element wise absolute gradient at the given point of the data given.
*
...
...
@@ -117,6 +119,8 @@ namespace eis
*/
fvalue
pearsonCorrelation
(
const
std
::
vector
<
eis
::
DataPoint
>&
data
);
fvalue
nonConstantScore
(
const
std
::
vector
<
eis
::
DataPoint
>&
data
);
/**
* @brief Calculates the variance of the distance of the data from a centroid in the nyquist plane.
*
...
...
This diff is collapsed.
Click to expand it.
model.cpp
+
8
−
0
View file @
3d8e4e1e
...
...
@@ -576,6 +576,14 @@ std::vector<size_t> Model::getRecommendedParamIndices(eis::Range omegaRange, dou
continue
;
}
fvalue
nonConstantess
=
std
::
abs
(
pearsonCorrelation
(
data
));
if
(
nonConstantess
<
0.1
)
{
eis
::
Log
(
eis
::
Log
::
DEBUG
)
<<
"skipping output for step "
<<
i
<<
" as data is too constant: "
<<
nonConstantess
;
continue
;
}
std
::
vector
<
std
::
vector
<
eis
::
DataPoint
>>::
iterator
search
;
if
(
threaded
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment