W3cubDocs

/TensorFlow Python

tf.contrib.receptive_field.compute_receptive_field_from_graph_def

tf.contrib.receptive_field.compute_receptive_field_from_graph_def(
    graph_def,
    input_node,
    output_node,
    stop_propagation=None,
    input_resolution=None
)

Defined in tensorflow/contrib/receptive_field/python/util/receptive_field.py.

Computes receptive field (RF) parameters from a Graph or GraphDef object.

The algorithm stops the calculation of the receptive field whenever it encounters an operation in the list stop_propagation. Stopping the calculation early can be useful to calculate the receptive field of a subgraph such as a single branch of the inception network.

Args:

  • graph_def: Graph or GraphDef object.
  • input_node: Name of the input node or Tensor object from graph.
  • output_node: Name of the output node or Tensor object from graph.
  • stop_propagation: List of operations or scope names for which to stop the propagation of the receptive field.
  • input_resolution: 2D list. If the input resolution to the model is fixed and known, this may be set. This is helpful for cases where the RF parameters vary depending on the input resolution (this happens since SAME padding in tensorflow depends on input resolution in general). If this is None, it is assumed that the input resolution is unknown, so some RF parameters may be unknown (depending on the model architecture).

Returns:

  • rf_size_x: Receptive field size of network in the horizontal direction, with respect to specified input and output.
  • rf_size_y: Receptive field size of network in the vertical direction, with respect to specified input and output.
  • effective_stride_x: Effective stride of network in the horizontal direction, with respect to specified input and output.
  • effective_stride_y: Effective stride of network in the vertical direction, with respect to specified input and output.
  • effective_padding_x: Effective padding of network in the horizontal direction, with respect to specified input and output.
  • effective_padding_y: Effective padding of network in the vertical direction, with respect to specified input and output.

Raises:

  • ValueError: If network is not aligned or if either input or output nodes cannot be found. For network criterion alignment, see photos/vision/features/delf/g3doc/rf_computation.md

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/receptive_field/compute_receptive_field_from_graph_def