Complete Lux+Reactant migration: inference, callbacks, and multi-loss support#25
Complete Lux+Reactant migration: inference, callbacks, and multi-loss support#25AdityaPandeyCN wants to merge 13 commits intoEvovest:lux-newfrom
Conversation
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com> Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
|
Please take a look when free @jeremiedb. |
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
src/Fit/fit.jl
Outdated
There was a problem hiding this comment.
What is the need for all_batches?
Why not just keep dtrain_loader? Collecting the iterator doesn't seem a sound practice, it would notably cause problems if the dataloader was a lazy iterator accessing larger than memory data.
Also, I wasn't aware of of any issue when using Flux, nor in the initial Lux adaption under neuro-v3.
As per the one-hot, I don't think this should be needed either, as I'd expect the crossentropy loss to work fine with an integer encoding of the multi-class target. Or is it something specific that Lux doesn't support while Flux does?
| BatchNorm(nfeats), | ||
| Parallel( | ||
| vcat, | ||
| StackTree(nfeats => outsize; |
There was a problem hiding this comment.
The idea for stack tree was to facilitate the stacking of stack_size NeuroTrees in a residual network fashion.
That being said, maybe that model contruction in Lux makes it easy to do the equivalent by composing NeuroTrees in the same way as a vanilla residual architecture would do with Dense layers?
jeremiedb
left a comment
There was a problem hiding this comment.
Thanks! The initial benchmark look good.
I appreciate the cleanup regarding code dupliocation in inference, it was long due!
I left a couple of comments, which I think should be striaghforward to adress.
There's the collect of batches which appeared at first sight as not being a change needed, or that may be need a redesign within the DataLoader logic.
… with native for cleaner residual stacking. Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
This PR adds
_forwardusing Lux.apply with separated params/state for inference,_sync_params_to_model!to copy TrainState to CPU for callbacks,_get_lux_lossto dispatch the correct loss per task, one-hot encoding for classification targets, andfit_iter!for MLJ support.