You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionloss_fnc(tree, dataset::Dataset{T,L}, options, idx) where {T,L}
# Extract data for the given indices
X = idx ===nothing? dataset.X :view(dataset.X, :, idx)
y = idx ===nothing? dataset.y :view(dataset.y, idx)
weights = idx ===nothing? dataset.weights :view(dataset.weights, idx)
prediction, grad, complete =eval_grad_tree_array(tree, X, options;variable=true)
if!complete
returnL(Inf)
endprintln("Size of grad: ", size(grad))
#....remainingcode
This throws a nested task error: TaskFailedException when batching=true. Furthermore, size of grad: (6, 4927), rather than grad: (6, 50) for 6 features.
The code works if I turn off batching.
If I switch to diff instead of grad for one feature:
Thanks for the report. It looks like the key part of the error is
TypeError:in typeassert, expected Tuple{Vector{Float32}, SubArray{Float32, 2, Matrix{Float32}, Tuple{Base.Slice{Base.OneTo{Int64}}, Vector{Int64}}, false}, Bool}, got a value of type Tuple{Vector{Float32}, LinearAlgebra.Adjoint{Float32, Matrix{Float32}}, Bool}
As a temporary workaround I think you can replace
view(dataset.X, :, idx)
With
dataset.X[:, idx]
The fault looks to be a bug so I’ll try to fix it for 1.0.0.
Also note that even when batching is true, Sometimes SR.jl will still do full evaluation with idx == nothing, for things like comparing expressions in the hall of fame, since otherwise an expression might “get lucky” and be recorded as the best expression seen due to an easier batch.
What happened?
This throws a nested task error: TaskFailedException when batching=true. Furthermore, size of grad: (6, 4927), rather than grad: (6, 50) for 6 features.
The code works if I turn off batching.
If I switch to diff instead of grad for one feature:
This now correctly works with batching and outputs the expected size of 50.
The error triggers shortly after Info: Started!
I am on Julia version 1.10.4
Initialisation:
I apologise if I am overlooking something.
Version
v1.0.0-beta1
Operating System
Windows
Interface
Julia REPL
Relevant log output
Extra Info
No response
The text was updated successfully, but these errors were encountered: