FluxML / MLJFlux.jl

Wrapping deep learning models from the package Flux.jl for use in the MLJ.jl toolbox
http://fluxml.ai/MLJFlux.jl/
MIT License
143 stars 17 forks source link

[Docs] Using `convert2image` instead of `coerce` for MNIST example #217

Closed pat-alt closed 11 months ago

pat-alt commented 1 year ago

First things first: awesome package, great to have a Flux interface to MLJ 🙏🏽 .

When using X = coerce(Xraw, GrayImage), it seems like the image gets flipped and rotated.

image

When relying on MLDatasets.convert2image instead, this does not happen:

image

I can't tell if this has to do with the internals of MLDatasets or the way coerce works. I also imagine that you want to showcase coerce in the tutorial, so I've only made a minor addition to the Jupyter notebook suggesting the use of convert2image instead:

using Images
using MLDatasets
images = map(x -> convert2image(MNIST, x), eachslice(images, dims=3))
@assert scitype(images) <: AbstractVector{<:Image}

Note that the assertion still passes.

Perhaps of interest: I noted this when working on these docs for my own package.

codecov-commenter commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (bf410e1) 92.92% compared to head (55f7bfb) 92.92%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #217 +/- ## ======================================= Coverage 92.92% 92.92% ======================================= Files 11 11 Lines 311 311 ======================================= Hits 289 289 Misses 22 22 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Flux). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Flux)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

ablaom commented 1 year ago

@pat-alt Nice tutorial at ConformalPrediction, and thanks for chipping in here.

Strange observation. I've just looked over the code for coerce and I don't see any kind of transposition there. Maybe this is an idiosyncrasy of the MNIST data set at MLDatasets.jl??

@CarloLucibello Do you have any clue what's going on here?