Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noncritical bug in deciding how often to repeat nontopology optimization #84

Open
lutteropp opened this issue Aug 20, 2021 · 0 comments

Comments

@lutteropp
Copy link
Owner

TODO: Compare current implementation with this pseudocode:

\section{Pseudcodes for Nontopology Optimization}

\begin{algorithm}
\DontPrintSemicolon
\KwIn{The current network $annNetwork$ with parameter vector $\vartheta$; the optimization type $type$.}
\KwOut{The current network, with optimized non-topology parameters in $\vartheta$.}
score_epsilon $\gets 0.01$;
max_rounds_slow $\gets 2$;
act_rounds_slow $\gets 0$;
got_better_slow $\gets$ True;
\While{got_better_slow \textbf{and} act_rounds_slow $<$ max_rounds_slow}{
score_slow_before $\gets$ scoreNetwork(annNetwork);
got_better_slow $\gets$ False;
do_brlen_opt $\gets$ True;
do_model_opt $\gets$ True;
do_reticulation_opt $\gets$ True;
got_better $\gets$ True;
\While{got_better}{
got_better $\gets$ False;
score_before $\gets$ scoreNetwork(annNetwork);
\If{do_model_opt}{
score_before_modelopt $\gets$ scoreNetwork(annNetwork);
optimizeModel(annNetwork);
score_after_modelopt $\gets$ scoreNetwork(annNetwork);
\If{score_before_modelopt - score_after_modelopt $<$ score_epsilon}
{
do_model_opt $\gets$ False;
}
}
\If{do_brlen_opt}{
score_before_brlenopt $\gets$ scoreNetwork(annNetwork);
optimizeBranches(annNetwork);
score_after_brlenopt $\gets$ scoreNetwork(annNetwork);
\If{score_before_brlenopt - score_after_brlenopt $<$ score_epsilon}
{
do_brlen_opt $\gets$ False;
}
}
\If{do_reticulation_opt}{
score_before_reticulation_opt $\gets$ scoreNetwork(annNetwork);
optimizeReticulations(annNetwork);
score_after_reticulation_opt $\gets$ scoreNetwork(annNetwork);
\If{score_before_reticulation_opt - score_after_reticulation_opt $>$ score_epsilon}
{
do_reticulation_opt $\gets$ False;
}
}
score_after $\gets$ scoreNetwork(annNetwork);
\If{score_before - score_after $>$ score_epsilon}
{
\If{type $\neq$ QUICK}
{
got_better $\gets$ True;
}
}
}
score_slow_after $\gets$ scoreNetwork(annNetwork);
\If{score_before - score_after $>$ score_epsilon \textbf{and} type = SLOW}{
got_better_slow $\gets$ True;
}
act_rounds_slow += 1;
}
\Return{annNetwork};
\caption{optimizeNonTopology: Optimize all non-topology parameters.}
\label{alg:nontopology_opt}
\end{algorithm}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant