-
Notifications
You must be signed in to change notification settings - Fork 4
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
Making checkpoint a macro #20
Comments
Can you give an example? How's this different from your last point?
Hmm, this feels like it's bordering on logging functionality. We could make the same argument for a Memento.jl macro which does the same thing.
Personally, this point doesn't seem worth it, but getting filename and line number might be.
Yeah, we had a similar issue in Memento and the conclusion was that the limitations and maintenance overhead wasn't really worth it. That issue even had a performance argument. invenia/Memento.jl#15 |
ah sorry, yeah i was unclear. I mean a record of the names of what it records. julia> checkpoint_info()
module | name | stores
-------------|---------------|------------------------------------------------
Forecasters | forecasts | targets, nodes, distributions
NodeSelection| nodes | selection_settings, all_nodes, selected_nodes
FooBar | qux | foobar, barfoo, quxbar, fooqux Probably be able to filter by module.
Yes. In someways you could replace Checkpoints.jl with something like TensorBoardLogger. The main difference from logging (other than spitting out binary artifacts) is that this is structured hierarchically, rather than sequentially. |
I ran into this just now, and happened across this issue. A (potentially less invasive) way we could approach this is to allow the "value" to be a zero-argument callable. So, to take @oxinabox 's example: checkpoint(
"RegressionSummary",
:value => () -> expensive_summary_function(foo),
) We'd then need to add a special-case for values that are callables, and call them before writing. |
We might likely to make
checkpoint
into a macroReasons for macro:
@checkpoint("RegressionSummary", value=expensive_summary_function(foo))
. (This is what the Base Logging macros do)register
them in__init__
by making it, at parse timeregister
it. (not 100% sure if this will work, since it is mutating a global variable at parse time, I think it does. If it doens’t then shouldn’t do this)checkpoint_info
that would print a list. As a kind of documentation.a
be the same as:a=>a
(though we also get this if we changes to storing data in the kwarg position Change checkpoint to becheckpoint(name, tags...; data...)
#16)On the otherhand macros are harder to reason about. so the gains might not be worth it.
I think low priority
The text was updated successfully, but these errors were encountered: