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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Klemm, Carl Philipp
Eisgenerator
Commits
54d57bd2
Commit
54d57bd2
authored
2 years ago
by
Carl Philipp Klemm
Browse files
Options
Downloads
Patches
Plain Diff
Model: add function to find the most interesting indecies
parent
92a75cbb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
eisgenerator/model.h
+1
-0
1 addition, 0 deletions
eisgenerator/model.h
model.cpp
+68
-0
68 additions, 0 deletions
model.cpp
with
69 additions
and
0 deletions
eisgenerator/model.h
+
1
−
0
View file @
54d57bd2
...
@@ -48,6 +48,7 @@ public:
...
@@ -48,6 +48,7 @@ public:
void
resolveSteps
(
int64_t
index
);
void
resolveSteps
(
int64_t
index
);
size_t
getRequiredStepsForSweeps
();
size_t
getRequiredStepsForSweeps
();
bool
isParamSweep
();
bool
isParamSweep
();
std
::
vector
<
size_t
>
getRecommendedParamIndices
(
eis
::
Range
omegaRange
,
double
distance
,
bool
threaded
=
false
);
};
};
}
}
This diff is collapsed.
Click to expand it.
model.cpp
+
68
−
0
View file @
54d57bd2
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
#include
<array>
#include
<array>
#include
<thread>
#include
<thread>
#include
<fstream>
#include
<fstream>
#include
<algorithm>
#include
<execution>
#include
"strops.h"
#include
"strops.h"
#include
"cap.h"
#include
"cap.h"
...
@@ -16,6 +18,8 @@
...
@@ -16,6 +18,8 @@
#include
"warburg.h"
#include
"warburg.h"
#include
"paralellseriel.h"
#include
"paralellseriel.h"
#include
"log.h"
#include
"log.h"
#include
"normalize.h"
#include
"basicmath.h"
using
namespace
eis
;
using
namespace
eis
;
...
@@ -451,3 +455,67 @@ bool Model::isParamSweep()
...
@@ -451,3 +455,67 @@ bool Model::isParamSweep()
{
{
return
getRequiredStepsForSweeps
()
>
1
;
return
getRequiredStepsForSweeps
()
>
1
;
}
}
std
::
vector
<
size_t
>
Model
::
getRecommendedParamIndices
(
eis
::
Range
omegaRange
,
double
distance
,
bool
threaded
)
{
std
::
vector
<
std
::
vector
<
eis
::
DataPoint
>>
sweeps
;
size_t
count
=
getRequiredStepsForSweeps
();
eis
::
Log
(
eis
::
Log
::
INFO
)
<<
"Executeing "
<<
count
<<
" steps"
;
std
::
vector
<
std
::
vector
<
eis
::
DataPoint
>>
allSweeps
;
std
::
vector
<
size_t
>
indices
;
if
(
threaded
)
allSweeps
=
executeAllSweeps
(
omegaRange
);
for
(
size_t
i
=
0
;
i
<
count
;
++
i
)
{
std
::
vector
<
eis
::
DataPoint
>
data
;
if
(
threaded
)
data
=
allSweeps
[
i
];
else
data
=
executeSweep
(
omegaRange
,
i
);
normalize
(
data
);
fvalue
maxJump
=
maximumNyquistJump
(
data
);
if
(
maxJump
>
0.30
)
{
eis
::
Log
(
eis
::
Log
::
DEBUG
)
<<
"skipping output for step "
<<
i
<<
" is not well centered: "
<<
maxJump
;
continue
;
}
fvalue
correlation
=
std
::
abs
(
pearsonCorrelation
(
data
));
if
(
correlation
>
0.8
)
{
eis
::
Log
(
eis
::
Log
::
DEBUG
)
<<
"skipping output for step "
<<
i
<<
" as data is too linear: "
<<
correlation
;
continue
;
}
std
::
vector
<
std
::
vector
<
eis
::
DataPoint
>>::
iterator
search
;
if
(
threaded
)
{
search
=
std
::
find_if
(
std
::
execution
::
par
,
sweeps
.
begin
(),
sweeps
.
end
(),
[
distance
,
&
data
](
std
::
vector
<
eis
::
DataPoint
>&
a
){
return
distance
>
eisDistance
(
data
,
a
);});
}
else
{
search
=
std
::
find_if
(
std
::
execution
::
seq
,
sweeps
.
begin
(),
sweeps
.
end
(),
[
distance
,
&
data
](
std
::
vector
<
eis
::
DataPoint
>&
a
){
return
distance
>
eisDistance
(
data
,
a
);});
}
if
(
search
==
sweeps
.
end
())
{
indices
.
push_back
(
i
);
sweeps
.
push_back
(
data
);
if
(
threaded
)
resolveSteps
(
i
);
}
if
(
i
%
200
==
0
)
{
eis
::
Log
(
eis
::
Log
::
INFO
,
false
)
<<
'.'
;
std
::
cout
<<
std
::
flush
;
}
}
eis
::
Log
(
eis
::
Log
::
INFO
,
false
)
<<
'\n'
;
return
indices
;
}
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