Giter Club home page Giter Club logo

Comments (7)

alxy avatar alxy commented on May 18, 2024 1

Maybe the parameter should work the other way round, because actually your PR is a breaking change, if someone relies on the fact that the input variable is indeed standardized. I assume this is a very edgy case, however, I can think of it.

from keras-preprocessing.

Dref360 avatar Dref360 commented on May 18, 2024

It is as designed, mostly to reuse memory when possible. When using jupyter, I would suggest providing a copy of the input instead.

from keras-preprocessing.

rragundez avatar rragundez commented on May 18, 2024

In this case I agree with @alxy. This is a bad practice and should be avoided, as it is an unexpected behavior that faces the user and can have unexpected consequences down the pipeline, which normally turns out to be a nightmare to debug. Since Keras puts the user first this should be avoided on any function facing the user directly. The behavior of course reduces the memory footprint and can bring benefits, but it should only be used on internal logic not on top-level user facing functions.

That's why for example we do this: https://github.com/keras-team/keras-preprocessing/blob/master/keras_preprocessing/image/dataframe_iterator.py#L106 even though this holds two copies of the dataframe at some point in time, but the user is first so we do it.

@Dref360 I made a PR #138 to address this issue. If there are more places where this happens it should be addressed as well.

from keras-preprocessing.

gglanzani avatar gglanzani commented on May 18, 2024

Modify in place wouldn't be bad if you wouldn't return a value.

If the user wishes to save memory, passing an extra param (in_place for example) is better suited.

from keras-preprocessing.

rragundez avatar rragundez commented on May 18, 2024

@Dref360 should we merge the related PR and close this issue? then we can discuss the introduction of an inplace argument or so. I need a review on the PR though before I can merge.

from keras-preprocessing.

rragundez avatar rragundez commented on May 18, 2024

Good point, specially because it is used internally by the ImageDataGenerator in this way. I'll update the PR, thanks for the feedback.

from keras-preprocessing.

gabrieldemarmiesse avatar gabrieldemarmiesse commented on May 18, 2024

I believe this can be closed.

from keras-preprocessing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.