[AIFFEL] 22.Mar.17, GD_ResNet_Ablation_Study


今日の学習リスト

  • fig = tfds.show_examples(ds_train, ds_info)
  • Visualize images (and labels) from an image classification dataset.
  • tfds.visualization.show_examples(
        ds: tf.data.Dataset,
        ds_info: tfds.core.DatasetInfo,
        **options_kwargs
    )
  • KerasTensorTensorは違います
  • https://keras.io/api/utils/backend_utils/
  • tf.keras.Model
  • Model groups layers into an object with training and inference features.
  • Inherits From: Layer , Module
  • With the "Functional API", where you start from Input, you chain layer calls to specify the model's forward pass, and finally you create your model from inputs and outputs
  • paddingstrides一緒にいるときに混同してしまうと
  • input_shape = (4, 32, 32, 3)
    x = tf.random.normal(input_shape)
    y = tf.keras.layers.Conv2D(
    3, 3, activation='relu', padding='same' strides=2, input_shape=input_shape[1:])(x)
    print(y.shape)
  • の上のコードでこれとその
  • をテストします

    ResNet実装


  • conv blockの実装

  • BN&アクティブな場所とタイプ
  • p 4. "We adopt batch
    normalization (BN) [16] right after each convolution and
    前のアクティブ化、後の[16]
  • を参照してください.

  • Shortcut接続の実装

  • p 3. "The operation F+xF +\mathbf{x}F+x is performed by a shortcut
    connection and element-wise addition. We adopt the second
    nonlinearity after the addition (i.e.,  (y), see Fig. 2)."

  • p 3. _"The dimensions of x\mathbf{x}x and FFF must be equal in Eqn.(1).
    If this is not the case (e.g., when changing the input/output
    channels), we can perform a linear projection WsW_sWs​ by the
    shortcut connections to match the dimensions:"

  • p 4. "When the dimensions increase (dotted line shortcuts
    in Fig. 3), we consider two options: (A) The shortcut still
    performs identity mapping, with extra zero entries padded
    for increasing dimensions. This option introduces no extra
    parameter; (B) The projection shortcut in Eqn.(2) is used to
    match dimensions (done by 1 x 1 convolutions)."

  • p 5. "In the first comparison (Table 2 and Fig. 4 right),
    we use identity mapping for all shortcuts and zero-padding
    for increasing dimensions (option A)"-> ResNet-34

  • p 6. "In Table 3 we
    compare three options: (A) zero-padding shortcuts are used
    for increasing dimensions, and all shortcuts are parameterfree
    (the same as Table 2 and Fig. 4 right); (B) projection
    shortcuts are used for increasing dimensions, and other
    shortcuts are identity; and (C) all shortcuts are projections.... So we
    do not use option C in the rest of this paper,"

  • 1つの関数でResNet-34とResNet-50を有効にします.
  • end_blcok
  • Global Average Pooling
  • それがどんなものか知りたいなら、いつ使うか、リンク2