Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
acts-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
acts
acts-core
Commits
577e12d2
Commit
577e12d2
authored
5 years ago
by
Bastian Schlag
Browse files
Options
Downloads
Patches
Plain Diff
update AnnealingUtility implementation
parent
b25e3c26
No related branches found
No related tags found
1 merge request
!802
Remove propagator options from vertexing configs and performance upgrades
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/src/Utilities/AnnealingUtility.cpp
+9
-9
9 additions, 9 deletions
Core/src/Utilities/AnnealingUtility.cpp
with
9 additions
and
9 deletions
Core/src/Utilities/AnnealingUtility.cpp
+
9
−
9
View file @
577e12d2
...
...
@@ -15,7 +15,7 @@
///
/// @return exp(-1./2. * chi2 / temp)
static
double
gaussFunc
(
double
chi2
,
double
temp
)
{
return
std
::
exp
(
-
1.
/
2.
*
chi2
/
temp
);
return
std
::
exp
(
-
chi2
/
(
2.
*
temp
)
)
;
}
void
AnnealingUtility
::
anneal
(
State
&
state
)
const
{
...
...
@@ -31,20 +31,20 @@ double AnnealingUtility::getWeight(State& state, double chi2,
const
double
currentTemp
=
m_cfg
.
setOfTemperatures
[
state
.
currentTemperatureIndex
];
double
allWeights
=
0.
;
for
(
auto
val
:
allChi2
)
{
allWeights
+=
gaussFunc
(
val
,
currentTemp
);
}
double
base
=
gaussFunc
(
1.
,
currentTemp
);
double
denom
=
std
::
pow
(
base
,
m_cfg
.
cutOff
-
chi2
);
double
actualWeight
=
gaussFunc
(
chi2
,
currentTemp
);
for
(
double
val
:
allChi2
)
{
denom
+=
std
::
pow
(
base
,
val
-
chi2
);
}
return
actualWeight
/
(
gaussFunc
(
m_cfg
.
cutOff
,
currentTemp
)
+
allWeights
)
;
return
1.
/
denom
;
}
double
AnnealingUtility
::
getWeight
(
State
&
state
,
double
chi2
)
const
{
const
double
currentTemp
=
m_cfg
.
setOfTemperatures
[
state
.
currentTemperatureIndex
];
return
gaussFunc
(
chi2
,
currentTemp
)
/
(
gaussFunc
(
m_cfg
.
cutOff
,
currentTemp
)
+
gaussFunc
(
chi2
,
currentTemp
));
return
1.
/
(
1.
+
gaussFunc
(
m_cfg
.
cutOff
-
chi2
,
currentTemp
));
}
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