-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi @NHDaly,
I saw another reference to Salsa today, and it struck me that this could be very effective for probabilistic programming! I found a very nice description of the ML example here:
94db4dd
But when I try this, I get
julia> s1 = let s = SalsaMLIncr.new_lr_runtime()
for i in 1:10
for _ in 1:100
SalsaMLIncr.insert_training_pair!(s, (i,), i + rand(-1.0:1.0))
end
# Time remains constant: O(the batch size, or, 100)
@time SalsaMLIncr.predict(s, (rand(),))
end
s
end
ERROR: DerivedFunctionException: Error encountered while executing derived function:
MethodError: no method matching get_map_for_key(::Salsa._DefaultSalsaStorage.DefaultStorage, ::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_δweights_δmse), Tuple{Int64}})
Closest candidates are:
get_map_for_key(::Salsa._DefaultSalsaStorage.DefaultStorage, ::KT, ::Type{RT}) where {TT, KT<:(Salsa.DerivedKey{<:Any, TT}), RT} at ~/git/Salsa.jl/src/default_storage.jl:101
get_map_for_key(::Salsa._DefaultSalsaStorage.DefaultStorage, ::Salsa.InputKey) at ~/git/Salsa.jl/src/default_storage.jl:119
------ Salsa Trace -----------------
[3] @derived lr_learned_weights(::Runtime)
[2] @derived lr_learned_weights_unrolled(::Runtime, 1::Int64)
[1] @derived lr_δweights_δmse(::Runtime, 0::Int64)
------------------------------------
Stacktrace:
[1] macro expansion
@ ~/git/Salsa.jl/src/default_storage.jl:136 [inlined]
[2] macro expansion
@ ./lock.jl:228 [inlined]
[3] _previous_output_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_δweights_δmse), Tuple{Int64}})
@ Salsa._DefaultSalsaStorage ~/git/Salsa.jl/src/default_storage.jl:135
[4] previous_output(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage})
@ Salsa ~/git/Salsa.jl/src/runtime_tracing.jl:98
[5] var"%%__user_lr_δweights_δmse"(s::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, iteration::Int64)
@ Main.SalsaMLIncr ~/git/Salsa.jl/examples/ML-LR-IVM/linear-regression-incremental.jl:68
[6] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_δweights_δmse), Tuple{Int64}})
@ Salsa._DefaultSalsaStorage ~/git/Salsa.jl/src/default_storage.jl:257
[7] memoized_lookup(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_δweights_δmse), Tuple{Int64}})
@ Salsa ~/git/Salsa.jl/src/runtime_generic.jl:20
[8] memoized_lookup_unwrapped
@ ~/git/Salsa.jl/src/runtime_generic.jl:43 [inlined]
[9] lr_δweights_δmse
@ ~/git/Salsa.jl/src/derived_macro.jl:109 [inlined]
[10] var"%%__user_lr_learned_weights_unrolled"(s::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, iteration::Int64)
@ Main.SalsaMLIncr ~/git/Salsa.jl/examples/ML-LR-IVM/linear-regression-incremental.jl:58
[11] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_learned_weights_unrolled), Tuple{Int64}})
@ Salsa._DefaultSalsaStorage ~/git/Salsa.jl/src/default_storage.jl:257
[12] memoized_lookup(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_learned_weights_unrolled), Tuple{Int64}})
@ Salsa ~/git/Salsa.jl/src/runtime_generic.jl:20
[13] memoized_lookup_unwrapped(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_learned_weights_unrolled), Tuple{Int64}})
@ Salsa ~/git/Salsa.jl/src/runtime_generic.jl:43
[14] lr_learned_weights_unrolled
@ ~/git/Salsa.jl/src/derived_macro.jl:109 [inlined]
[15] var"%%__user_lr_learned_weights"(s::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage})
@ Main.SalsaMLIncr ~/git/Salsa.jl/examples/ML-LR-IVM/linear-regression-incremental.jl:40
[16] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_learned_weights), Tuple{}})
@ Salsa._DefaultSalsaStorage ~/git/Salsa.jl/src/default_storage.jl:257
[17] memoized_lookup(rt::Salsa._TopLevelRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(Main.SalsaMLIncr.lr_learned_weights), Tuple{}})
@ Salsa ~/git/Salsa.jl/src/runtime_generic.jl:20
[18] memoized_lookup_unwrapped
@ ~/git/Salsa.jl/src/runtime_generic.jl:43 [inlined]
[19] lr_learned_weights(s::Salsa._TopLevelRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage})
@ Main.SalsaMLIncr ~/git/Salsa.jl/src/derived_macro.jl:109
[20] predict
@ ~/git/Salsa.jl/examples/ML-LR-IVM/linear-regression-incremental.jl:28 [inlined]
[21] macro expansion
@ ./timing.jl:220 [inlined]
[22] top-level scope
@ ./REPL[45]:7
I guess something in the code changed to make this no longer work? Is there a way to get it going again?
BTW Salsa is really cool, I wish I had learned more about it when we worked together :)
Metadata
Metadata
Assignees
Labels
No labels