0

https://keras.io/preprocessing/image/

I'm working on image pre-processing and read the Keras documentation above. About a quarter of the way down you see the following:

train_datagen = ImageDataGenerator(
        rescale=1./255,
        shear_range=0.2,
        zoom_range=0.2,
        horizontal_flip=True)

Why do they have ./ instead of just a /? Thank you in advance.

Nicklovn
  • 279
  • 4
  • 14
  • 5
    In Python 3.x, there is no difference. In Python 2.7, 1/255=0. – DYZ Jan 08 '19 at 01:32
  • 1
    see [this](https://stackoverflow.com/questions/1267869/how-can-i-force-division-to-be-floating-point-division-keeps-rounding-down-to-0) – busybear Jan 08 '19 at 01:36
  • Thank you for the replies. I tested it myself and see now that in Python 3.6 there does not appear to be a difference. 1/255 and 1./255 are both floats. Thanks again. – Nicklovn Jan 08 '19 at 01:39

0 Answers0