-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Spectator observer and convert existing observers to dedicated crates #311
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stefan-k
force-pushed
the
egui_observer
branch
2 times, most recently
from
February 3, 2023 10:13
1a1b0b3
to
d0744ee
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #311 +/- ##
==========================================
- Coverage 93.30% 90.25% -3.05%
==========================================
Files 117 126 +9
Lines 18875 19679 +804
==========================================
+ Hits 17611 17761 +150
- Misses 1264 1918 +654 ☔ View full report in Codecov by Sentry. |
stefan-k
force-pushed
the
egui_observer
branch
2 times, most recently
from
February 4, 2023 07:53
b64188a
to
ba8da6d
Compare
stefan-k
force-pushed
the
egui_observer
branch
2 times, most recently
from
February 26, 2023 10:34
91f0c7f
to
61850cc
Compare
stefan-k
force-pushed
the
egui_observer
branch
3 times, most recently
from
January 9, 2024 09:04
4eeda1e
to
d28a203
Compare
stefan-k
force-pushed
the
egui_observer
branch
from
January 9, 2024 09:11
d28a203
to
9df40ec
Compare
stefan-k
force-pushed
the
egui_observer
branch
4 times, most recently
from
January 10, 2024 13:31
7142da0
to
27fbba1
Compare
stefan-k
force-pushed
the
egui_observer
branch
from
January 10, 2024 13:44
30d5f2f
to
072540c
Compare
stefan-k
changed the title
Egui observer
Spectator observer and convert existing observers to dedicated crates
Jan 10, 2024
stefan-k
force-pushed
the
egui_observer
branch
2 times, most recently
from
January 10, 2024 15:41
789086b
to
17b517d
Compare
stefan-k
force-pushed
the
egui_observer
branch
from
January 10, 2024 15:44
17b517d
to
cdf31b7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A simple egui observer which shows the progress of the optimization in plots. Plots can selectively be shown or hidden.
This is still very basic and will change substantially until it is ready for merging.
Feedback is welcome!
Todos
argmin-observer-egui
SlogLogger
in dedicated crateargmin-observer-slog
slog_logger
feature from argminWriteToFile
toParamWriter
ParamWriter
in dedicated crateargmin-observer-paramwriter
argmin-observer-slog
documentationargmin-observer-paramwriter
documentationCaveats
Apparently GUIs need to run in the main thread, which is not possible in this case. I solved this by running the GUI in a separate process using theprocspawn
crate. Samples are then sent viaipc_channel
which unfortunately doesn't work on Windows. Therefore Windows support is not possible until there is a reasonable way to communicate with the process that also works on Windows.I haven't found a way to redraw the GUI only when new data comes in. Either it is redrawn as often as possible (with every call toupdate
) or only when there is "GUI input" such as mouse movements. I'd like to redraw whenever there is new data on the channel.This slows down the optimization substantially, which is probably fine and shouldn't be noticeable for cost functions that aren't super fast to compute. I guess such observers are used only during development/tuning and not "in production", where speed matters.Changes outside of the new observer
get_float
ofKVType
also works for all other numeric types now by converting those to floats. int and uint are cast to f64, therefore this operation may be lossy.SlogLogger
is now part of the crateargmin-observer-slog
WriteToFile
was renamed toParamWriter
and is now part of the crateargmin-observer-paramwriter
. The enumWriteToFileSerializer
was renamed toParamWriterFormat
and the variantBincode
was renamed toBinary
.ParamWriter
now chooses the extension based on the format..json
for JSON and.bin
for Binary.Observe
trait now has aobserver_final
method which is executed at the end of an optimization run.observe_init
in theObserve
trait now has access to the optimization stateOther things for the future