Úprava konvolucí

Image Modeling with Keras

Ariel Rokem

Senior Data Scientist, University of Washington

Konvoluce

Image Modeling with Keras

Konvoluce s nulovým paddingem

Image Modeling with Keras

Nulový padding v Keras

model.add(Conv2D(10, kernel_size=3, activation='relu', 
                 input_shape=(img_rows, img_cols, 1)),
                 padding='valid')
Image Modeling with Keras

Nulový padding v Keras

model.add(Conv2D(10, kernel_size=3, activation='relu', 
                 input_shape=(img_rows, img_cols, 1)),
                 padding='same')
Image Modeling with Keras

Kroky

Image Modeling with Keras

Kroky v Keras

model.add(Conv2D(10, kernel_size=3, activation='relu', 
                 input_shape=(img_rows, img_cols, 1)),
          strides=1)
Image Modeling with Keras

Kroky v Keras

model.add(Conv2D(10, kernel_size=3, activation='relu', 
                 input_shape=(img_rows, img_cols, 1)),
          strides=2)
Image Modeling with Keras

Příklad

Image Modeling with Keras

Výpočet velikosti výstupu

$$O = ((I - K + 2P) / S) + 1$$

kde

  • $I$ = velikost vstupu
  • $K$ = velikost jádra
  • $P$ = velikost nulového paddingu
  • $S$ = kroky
Image Modeling with Keras

Výpočet velikosti výstupu

$$ 28 = ((28 - 3 + 2) / 1) + 1$$

$$ 10 = ((28 - 3 + 2) / 3) + 1$$

Image Modeling with Keras

Dilatované konvoluce

Image Modeling with Keras

Dilatace v Keras

model.add(Conv2D(10, kernel_size=3, activation='relu', 
                 input_shape=(img_rows, img_cols, 1)),
          dilation_rate=2)
Image Modeling with Keras

Pojďme cvičit!

Image Modeling with Keras

Preparing Video For Download...