Skip to content

為何要對圖形中 0-255 的灰階像素值做 normalization (將灰階值數值範圍縮減到 [0 - 1])? #3

Description

@renewang

9/22 第二次讀書會(Chapter 2)現場提問

在 "A First Look at a Neural Network" note book 中,為何要將所有的灰階像素除以 255?(code example 如下)?

train_images = train_images.reshape((60000, 28 * 28))
train_images = train_images.astype('float32') / 255

test_images = test_images.reshape((10000, 28 * 28))
test_images = test_images.astype('float32') / 255

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions